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

Function forkTest

src/test/index.spec.ts:1141–1167  ·  view source on GitHub ↗
(
      command: string,
      expectParentArgv0: string,
      nodeFlag?: string
    )

Source from the content-addressed store, hash-verified

1139 );
1140
1141 function forkTest(
1142 command: string,
1143 expectParentArgv0: string,
1144 nodeFlag?: string
1145 ) {
1146 test(command, async (t) => {
1147 const { err, stderr, stdout } = await exec(
1148 `${command} --skipIgnore ./recursive-fork/index.ts argv2`
1149 );
1150 expect(err).toBeNull();
1151 expect(stderr).toBe('');
1152 const generations = stdout.split('\n');
1153 const expectation = {
1154 execArgv: [nodeFlag, BIN_PATH_JS, '--skipIgnore'].filter((v) => v),
1155 argv: [
1156 // Note: argv[0] is *always* BIN_PATH_JS in child & grandchild
1157 expectParentArgv0,
1158 resolve(TEST_DIR, 'recursive-fork/index.ts'),
1159 'argv2',
1160 ],
1161 };
1162 expect(JSON.parse(generations[0])).toMatchObject(expectation);
1163 expectation.argv[0] = BIN_PATH_JS;
1164 expect(JSON.parse(generations[1])).toMatchObject(expectation);
1165 expect(JSON.parse(generations[2])).toMatchObject(expectation);
1166 });
1167 }
1168 });
1169});
1170

Callers 1

index.spec.tsFile · 0.85

Calls 2

testFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…