MCPcopy
hub / github.com/TypeStrong/ts-node / testAllowedExtensions

Function testAllowedExtensions

src/test/index.spec.ts:1048–1066  ·  view source on GitHub ↗
(
      t: ExecutionContext<ctxTsNode.Ctx>,
      compilerOptions: CreateOptions['compilerOptions'],
      allowed: string[]
    )

Source from the content-addressed store, hash-verified

1046
1047 test.suite('issue #1098', (test) => {
1048 function testAllowedExtensions(
1049 t: ExecutionContext<ctxTsNode.Ctx>,
1050 compilerOptions: CreateOptions['compilerOptions'],
1051 allowed: string[]
1052 ) {
1053 const disallowed = allExtensions.filter((ext) => !allowed.includes(ext));
1054 const { ignored } = t.context.tsNodeUnderTest.create({
1055 compilerOptions,
1056 skipProject: true,
1057 });
1058 for (const ext of allowed) {
1059 t.log(`Testing that ${ext} files are allowed`);
1060 expect(ignored(join(DIST_DIR, `index${ext}`))).toBe(false);
1061 }
1062 for (const ext of disallowed) {
1063 t.log(`Testing that ${ext} files are ignored`);
1064 expect(ignored(join(DIST_DIR, `index${ext}`))).toBe(true);
1065 }
1066 }
1067
1068 const allExtensions = [
1069 '.ts',

Callers 1

index.spec.tsFile · 0.85

Calls 1

ignoredFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…