diff --git a/e2e/appTestTs/.gitignore b/e2e/appTestTs/.gitignore index 38209fae2..b51a7b38a 100644 --- a/e2e/appTestTs/.gitignore +++ b/e2e/appTestTs/.gitignore @@ -6,6 +6,7 @@ platforms/ # NativeScript Template *.js.map *.js +!karma.conf.js !webpack.config.js # Logs diff --git a/e2e/appTestTs/app/test-module.ts b/e2e/appTestTs/app/test-module.ts new file mode 100644 index 000000000..2b8d3de34 --- /dev/null +++ b/e2e/appTestTs/app/test-module.ts @@ -0,0 +1,9 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { Page } from "tns-core-modules/ui/page"; + +import { HelloWorldModel } from "./main-view-model"; + +export function navigatingTo(args: EventData) { + const page = args.object; + page.bindingContext = new HelloWorldModel(); +} diff --git a/e2e/appTestTs/app/test-module.xml b/e2e/appTestTs/app/test-module.xml new file mode 100644 index 000000000..6a13585d5 --- /dev/null +++ b/e2e/appTestTs/app/test-module.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/e2e/appTestTs/app/test-page.xml b/e2e/appTestTs/app/test-page.xml new file mode 100644 index 000000000..d2c7515ac --- /dev/null +++ b/e2e/appTestTs/app/test-page.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/e2e/appTestTs/app/tests/example.ts b/e2e/appTestTs/app/tests/example.ts index a287a2eba..28d6ca334 100644 --- a/e2e/appTestTs/app/tests/example.ts +++ b/e2e/appTestTs/app/tests/example.ts @@ -1,9 +1,47 @@ -// A sample Mocha test -describe('Array', function () { - describe('#indexOf()', function () { - it('should return -1 when the value is not present', function () { - assert.equal(-1, [1, 2, 3].indexOf(5)); - assert.equal(-1, [1, 2, 3].indexOf(0)); - }); +import { Builder, Label, Frame } from "@nativescript/core/ui"; + +import { navigateToModule } from "@nativescript/core/testing/ui-helper"; +import { assert } from "@nativescript/core/testing/tk-unit"; + +// function assert(test: any, message?: string) { +// if (!test) { +// throw new Error(message); +// } +// } + +const snippet = ` + + +` + +describe("---> describe", function () { + it("---> snippet", function () { + const rootView = Builder.parse(snippet); + const label =