Skip to content

Commit

Permalink
refactor(module-utils): 24.20x speed-up for generate dts tests (#2315)
Browse files Browse the repository at this point in the history
  • Loading branch information
barak007 authored and tzachbon committed Feb 21, 2022
1 parent d54ee44 commit 3c56d78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/dom-test-kit/test/stylable-dom-util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ describe('stylable-dom-utils type compliance', function () {
});
tk.linkNodeModules();

expect(tk.typecheck('test.ts')).to.equal('');
expect(tk.typecheck('test.ts', ['lib.dom.d.ts', 'lib.es2020.d.ts'])).to.equal('');
});
});
5 changes: 3 additions & 2 deletions packages/e2e-test-kit/src/dts-kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DTSKit {
}
}

public typecheck(internalPath: string) {
public typecheck(internalPath: string, lib: string[] = []) {
const filePath = this.sourcePath(internalPath);
const program = createProgram({
options: {
Expand All @@ -51,7 +51,8 @@ export class DTSKit {
target: ScriptTarget.ES2020,
strict: true,
types: [],
lib: ['lib.dom.d.ts', 'lib.es2020.d.ts'],
skipDefaultLibCheck: true,
lib: lib.length ? lib : ['lib.es2020.d.ts'],
},
rootNames: [filePath],
});
Expand Down

0 comments on commit 3c56d78

Please sign in to comment.