-
Notifications
You must be signed in to change notification settings - Fork 309
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(compiler): use TypeScript
LanguageService
instead of `Prog…
…ram` (#800)
- Loading branch information
Showing
22 changed files
with
207 additions
and
938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
94 changes: 33 additions & 61 deletions
94
src/__tests__/__snapshots__/ng-jest-compiler.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,41 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`NgJestCompiler with isolatedModule false should compile codes with useESM true 1`] = ` | ||
"import { __decorate } from \\"tslib\\"; | ||
import __NG_CLI_RESOURCE__0 from \\"./app.component.html\\"; | ||
import { Component } from '@angular/core'; | ||
let AppComponent = class AppComponent { | ||
constructor() { | ||
this.title = 'test-app-v10'; | ||
} | ||
}; | ||
AppComponent = __decorate([ | ||
Component({ | ||
selector: 'app-root', | ||
template: __NG_CLI_RESOURCE__0, | ||
styles: [] | ||
}) | ||
], AppComponent); | ||
export { AppComponent }; | ||
//# " | ||
exports[`NgJestCompiler with isolatedModules false should transform codes with useESM false using hoisting, replace resources and downlevel ctor transformers 1`] = ` | ||
Object { | ||
"before": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
} | ||
`; | ||
|
||
exports[`NgJestCompiler with isolatedModule false should compile new code when file changes: from hasErrorFileContent 1`] = ` | ||
"\\"use strict\\"; | ||
Object.defineProperty(exports, \\"__esModule\\", { value: true }); | ||
exports.AppComponent = void 0; | ||
const tslib_1 = require(\\"tslib\\"); | ||
const core_1 = require(\\"@angular/core\\"); | ||
let = class { | ||
constructor() { | ||
this. = ; | ||
} | ||
}; | ||
= tslib_1.__decorate([ | ||
core_1.Component({ | ||
selector: 'app-root', | ||
template: require(\\"./app.component.html\\"), | ||
styles: [] | ||
}) | ||
], ); | ||
exports.AppComponent = ; | ||
//# " | ||
exports[`NgJestCompiler with isolatedModules false should transform codes with useESM true using hoisting, replace resources and downlevel ctor transformers 1`] = ` | ||
Object { | ||
"before": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
} | ||
`; | ||
|
||
exports[`NgJestCompiler with isolatedModule false should compile new code when file changes: from noErrorFileContent 1`] = ` | ||
"\\"use strict\\"; | ||
Object.defineProperty(exports, \\"__esModule\\", { value: true }); | ||
exports.AppComponent = void 0; | ||
const tslib_1 = require(\\"tslib\\"); | ||
const core_1 = require(\\"@angular/core\\"); | ||
let AppComponent = class AppComponent { | ||
constructor() { | ||
this.title = 'test-app-v10'; | ||
} | ||
}; | ||
AppComponent = tslib_1.__decorate([ | ||
core_1.Component({ | ||
selector: 'app-root', | ||
template: require(\\"./app.component.html\\"), | ||
styles: [] | ||
}) | ||
], AppComponent); | ||
exports.AppComponent = AppComponent; | ||
//# " | ||
exports[`NgJestCompiler with isolatedModules true should transform codes with useESM false using hoisting, replace resources and downlevel ctor transformers 1`] = ` | ||
Object { | ||
"before": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
} | ||
`; | ||
|
||
exports[`NgJestCompiler with isolatedModule false should throw diagnostics error for new file which is: known by Program 1`] = `"src/__tests__/__mocks__/foo.component.ts(8,3): error TS2322: Type 'string' is not assignable to type 'number'."`; | ||
|
||
exports[`NgJestCompiler with isolatedModule false should throw diagnostics error for new file which is: not known by Program 1`] = `"src/__tests__/__mocks__/foo.component.ts(8,3): error TS2322: Type 'string' is not assignable to type 'number'."`; | ||
exports[`NgJestCompiler with isolatedModules true should transform codes with useESM true using hoisting, replace resources and downlevel ctor transformers 1`] = ` | ||
Object { | ||
"before": Array [ | ||
[Function], | ||
[Function], | ||
[Function], | ||
], | ||
} | ||
`; |
85 changes: 0 additions & 85 deletions
85
src/__tests__/__snapshots__/replace-resources.spec.ts.snap
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.