Skip to content

Commit ffbc5d0

Browse files
committed
test(schematics): moving away from non-compat ts-node
1 parent c694d41 commit ffbc5d0

58 files changed

Lines changed: 75 additions & 65 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test:lib:pgrid": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.pivot-grid.conf.js",
1919
"test:lib:others": "ng test igniteui-angular --watch=false --no-progress --code-coverage --karma-config=./projects/igniteui-angular/karma.non-grid.conf.js",
2020
"test:lib:watch": "ng test igniteui-angular --karma-config=./projects/igniteui-angular/karma.watch.conf.js",
21-
"test:schematics": "ts-node --project projects/igniteui-angular/migrations/tsconfig.json ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/migrations/**/*.spec.ts ./projects/igniteui-angular/schematics/**/*.spec.ts",
21+
"test:schematics": "gulp copySchematics && tsc --project ./projects/igniteui-angular/schematics/tsconfig.json && gulp copyMigrations && tsc --project ./projects/igniteui-angular/migrations/tsconfig.spec.json && node ./node_modules/jasmine/bin/jasmine.js \"dist/igniteui-angular/migrations/**/*.spec.js\" \"dist/igniteui-angular/schematics/**/*.spec.js\"",
2222
"test:styles": "ts-node --skip-project ./node_modules/jasmine/bin/jasmine.js ./projects/igniteui-angular/core/src/core/styles/spec/tests.mjs",
2323
"test:i18n": "ts-node --skip-project ./projects/igniteui-angular/core/src/core/i18n/tests/tests.mjs",
2424
"test:elements": "ng test igniteui-angular-elements --watch=false --no-progress --code-coverage --source-map=false",

projects/igniteui-angular/migrations/common/UpdateChanges.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UnitTestTree } from '@angular-devkit/schematics/testing';
1+
import { UnitTestTree } from '@angular-devkit/schematics/testing/index.js';
22
import * as fs from 'fs';
33
import * as path from 'path';
44
import { ClassChanges, BindingChanges, SelectorChanges, ThemeChanges, ImportsChanges, ElementType, ThemeType, MemberChanges } from './schema';

projects/igniteui-angular/migrations/common/setup.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { readFileSync } from 'fs';
22
import { join } from 'path';
33

44
import { EmptyTree } from '@angular-devkit/schematics';
5-
import { UnitTestTree } from '@angular-devkit/schematics/testing';
5+
import { UnitTestTree } from '@angular-devkit/schematics/testing/index.js';
66
import * as tss from 'typescript/lib/tsserverlibrary';
77
import { serviceContainer } from './project-service-container';
88

projects/igniteui-angular/migrations/tsconfig.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
{
2-
"ts-node": {
3-
"compilerOptions": {
4-
// explicitly force ts-node into CommonJS mode, otherwise spies on modules like `fs` fail as those are not configurable in ESM context
5-
"module": "CommonJS"
6-
}
7-
},
82
"compilerOptions": {
93
"target": "es6",
104
"module": "node16",
@@ -15,7 +9,7 @@
159
"typeRoots": [
1610
"../../../node_modules/@types"
1711
],
18-
"types": ["node"],
12+
"types": ["node", "jasmine"],
1913
"paths": {
2014
"igniteui-angular/*": [
2115
"../*"
@@ -27,8 +21,7 @@
2721
"skipLibCheck": true
2822
},
2923
"exclude": [
30-
"../../../node_modules",
31-
"**/*.spec.ts"
24+
"../../../node_modules"
3225
],
3326
"references": [
3427
{ "path": "../schematics" }
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "commonjs",
5+
"moduleResolution": "node",
6+
"esModuleInterop": false,
7+
"ignoreDeprecations": "6.0",
8+
"types": ["node", "jasmine"],
9+
"declaration": false,
10+
"sourceMap": false,
11+
"rootDir": "..",
12+
"outDir": "../../../dist/igniteui-angular"
13+
},
14+
"exclude": [
15+
"../../../node_modules"
16+
]
17+
}

projects/igniteui-angular/migrations/update-10_1_0/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path';
2-
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
2+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing/index.js';
33
import { setupTestTree } from '../common/setup.spec';
44

55
describe('Update 10.1.0', () => {

projects/igniteui-angular/migrations/update-10_2_0/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as path from 'path';
33
import {
44
SchematicTestRunner,
55
UnitTestTree,
6-
} from '@angular-devkit/schematics/testing';
6+
} from '@angular-devkit/schematics/testing/index.js';
77
import { setupTestTree } from '../common/setup.spec';
88

99
describe('Update 10.2.0', () => {

projects/igniteui-angular/migrations/update-11_0_0/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as path from 'path';
22

3-
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
3+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing/index.js';
44
import { setupTestTree } from '../common/setup.spec';
55

66
describe('Update to 11.0.0', () => {

projects/igniteui-angular/migrations/update-11_1_0/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as path from 'path';
22

3-
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
3+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing/index.js';
44
import { setupTestTree } from '../common/setup.spec';
55

66
describe('Update to 11.1.0', () => {

projects/igniteui-angular/migrations/update-12_0_0/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as path from 'path';
22

3-
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
3+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing/index.js';
44
import { setupTestTree } from '../common/setup.spec';
55

66
const version = '12.0.0';

0 commit comments

Comments
 (0)