Skip to content

Commit a925833

Browse files
alan-agius4clydin
authored andcommitted
test: update no_typescript_runtime_dep_spec to check javascript files
1 parent 56ffa1c commit a925833

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/schematics/angular/no_typescript_runtime_dep_spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ describe('@schematics/angular javascript code', () => {
2121
const file = path.join(subdir, f);
2222
if (fs.statSync(file).isDirectory()) {
2323
check(file);
24-
} else if (file.endsWith('.ts')) {
24+
} else if (file.endsWith('.js')) {
2525
const content = fs.readFileSync(file, { encoding: 'utf-8' });
26-
if (content.indexOf(`from 'typescript'`) >= 0) {
26+
if (content.includes(`require("typescript")`) || content.includes(`require('typescript')`)) {
2727
fail(`${file} has a typescript import`);
2828
}
2929
}

0 commit comments

Comments
 (0)