Skip to content

Instantly share code, notes, and snippets.

View dsibinski's full-sized avatar

Dawid Sibiński dsibinski

View GitHub Profile
import QuestionnaireCorrectTemplate from "./questionnaireCorrectTemplate";
import QuestionnaireCorrectTemplate from "./QuestionnaireCorrectTemplate";
"scripts": {
"build:dev:watch": "webpack --watch --config webpack.config.dev.js NODE_ENV=development"
}
function GetManagedYearlySalary(person: Employee | Manager) {
if ('employees' in person) {
person.getYearlySalariesOfAllEmployees();
} else {
person.getYearlySalary();
}
}
class Person {
name: string;
constructor(name: string) {
this.name = name;
}
}
class Employee extends Person {
salary: number;
function GetNumberOrLength(variable: string | number): number {
if (typeof variable === 'string') {
return variable.length;
} else {
return variable;
}
}
function GetNumberOrLength(variable: string | number): number {
return (variable as string).length;
}
function GetNumberOrLength(variable: string | number): number {
return variable.length;
}
public class FormTests: CypressTestsBase
{
[Test]
public void SubmitTests()
{
// some data initialization code here....
RunCypressTest("form/submit_spec.ts");
}
}
public class CypressTestsBase
{
protected void RunCypressTest(string cypressSpecFilePath)
{
var process = new System.Diagnostics.Process();
var testAssemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
if (string.IsNullOrEmpty(testAssemblyPath))
{
throw new Exception("Cannot find test assembly path!");
}