From bc8d6a3a752d70af69e7a49cedbd4bb6952e229c Mon Sep 17 00:00:00 2001 From: Georgii Dolzhykov Date: Mon, 6 Apr 2020 11:26:53 +0300 Subject: [PATCH] more tests --- .../__snapshots__/jsfmt.spec.js.snap | 85 +++++++++++++++++++ tests/typescript_as/assignment2.ts | 17 ++++ tests/typescript_as/long-identifiers.ts | 15 ++++ 3 files changed, 117 insertions(+) create mode 100644 tests/typescript_as/assignment2.ts create mode 100644 tests/typescript_as/long-identifiers.ts diff --git a/tests/typescript_as/__snapshots__/jsfmt.spec.js.snap b/tests/typescript_as/__snapshots__/jsfmt.spec.js.snap index 073735fef7bc..909ef504b150 100644 --- a/tests/typescript_as/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript_as/__snapshots__/jsfmt.spec.js.snap @@ -188,6 +188,53 @@ this.intervalID = (setInterval(() => { ================================================================================ `; +exports[`assignment2.ts 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const defaultMaskGetter = $parse(attrs[directiveName]) as ( + scope: ng.IScope +) => Mask; + +(this.configuration as any) = (this.editor as any) = (this + .editorBody as any) = undefined; + +angular.module("foo").directive("formIsolator", () => { + return { + name: "form", + controller: class FormIsolatorController { + $addControl = angular.noop; + } as ng.IControllerConstructor, + }; +}); + +(this.selectorElem as any) = this.multiselectWidget = this.initialValues = undefined; + +=====================================output===================================== +const defaultMaskGetter = $parse(attrs[directiveName]) as ( + scope: ng.IScope +) => Mask; + +(this.configuration as any) = (this.editor as any) = (this + .editorBody as any) = undefined; + +angular.module("foo").directive("formIsolator", () => { + return { + name: "form", + controller: class FormIsolatorController { + $addControl = angular.noop; + } as ng.IControllerConstructor, + }; +}); + +(this + .selectorElem as any) = this.multiselectWidget = this.initialValues = undefined; + +================================================================================ +`; + exports[`export_default_as.ts 1`] = ` ====================================options===================================== parsers: ["typescript"] @@ -202,6 +249,44 @@ export default (function log() {} as typeof console.log); ================================================================================ `; +exports[`long-identifiers.ts 1`] = ` +====================================options===================================== +parsers: ["typescript"] +printWidth: 80 + | printWidth +=====================================input====================================== +const bifornCringerMoshedPerplexSawder = + askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie; + +averredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol = + annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave; + +averredBathersBoxroomBuggyNurl = { + anodyneCondosMalateOverateRetinol: + annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave +}; + +averredBathersBoxroomBuggyNurl( + anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as + kochabCooieGameOnOboleUnweave +); + +=====================================output===================================== +const bifornCringerMoshedPerplexSawder = askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie; + +averredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol = annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave; + +averredBathersBoxroomBuggyNurl = { + anodyneCondosMalateOverateRetinol: annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave, +}; + +averredBathersBoxroomBuggyNurl( + anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave +); + +================================================================================ +`; + exports[`return.ts 1`] = ` ====================================options===================================== parsers: ["typescript"] diff --git a/tests/typescript_as/assignment2.ts b/tests/typescript_as/assignment2.ts new file mode 100644 index 000000000000..1f163057a0d4 --- /dev/null +++ b/tests/typescript_as/assignment2.ts @@ -0,0 +1,17 @@ +const defaultMaskGetter = $parse(attrs[directiveName]) as ( + scope: ng.IScope +) => Mask; + +(this.configuration as any) = (this.editor as any) = (this + .editorBody as any) = undefined; + +angular.module("foo").directive("formIsolator", () => { + return { + name: "form", + controller: class FormIsolatorController { + $addControl = angular.noop; + } as ng.IControllerConstructor, + }; +}); + +(this.selectorElem as any) = this.multiselectWidget = this.initialValues = undefined; diff --git a/tests/typescript_as/long-identifiers.ts b/tests/typescript_as/long-identifiers.ts new file mode 100644 index 000000000000..6fb9bca9398b --- /dev/null +++ b/tests/typescript_as/long-identifiers.ts @@ -0,0 +1,15 @@ +const bifornCringerMoshedPerplexSawder = + askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie; + +averredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol = + annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave; + +averredBathersBoxroomBuggyNurl = { + anodyneCondosMalateOverateRetinol: + annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave +}; + +averredBathersBoxroomBuggyNurl( + anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as + kochabCooieGameOnOboleUnweave +);