Skip to content

Commit

Permalink
fix: Resolving Lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinuehara committed Sep 23, 2024
1 parent f5ef1e0 commit 5c4f180
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions test/es-module/test-typescript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -327,33 +327,32 @@ test('execute a JavaScript file importing a cjs TypeScript file', async () => {

test('execute a TypeScript file with union types', async () => {
const result = await spawnPromisified(process.execPath, [
'--experimental-strip-types',
'--no-warnings',
fixtures.path('typescript/ts/test-union-types.ts'),
'--experimental-strip-types',
'--no-warnings',
fixtures.path('typescript/ts/test-union-types.ts'),
]);


strictEqual(result.stderr, '');
strictEqual(result.stdout,
'{' +
" name: 'Hello, TypeScript!' }\n" +
'{ role: \'admin\', permission: \'all\' }\n' +
'{\n foo: \'Testing Partial Type\',\n bar: 42,\n' +
' zoo: true,\n metadata: undefined\n' +
'}\n');
'{' +
" name: 'Hello, TypeScript!' }\n" +
'{ role: \'admin\', permission: \'all\' }\n' +
'{\n foo: \'Testing Partial Type\',\n bar: 42,\n' +
' zoo: true,\n metadata: undefined\n' +
'}\n');
strictEqual(result.code, 0);
});

test('expect error when executing a TypeScript file with generics', async () => {
const result = await spawnPromisified(process.execPath, [
'--experimental-strip-types',
fixtures.path('typescript/ts/test-parameter-properties.ts'),
'--experimental-strip-types',
fixtures.path('typescript/ts/test-parameter-properties.ts'),
]);

// This error should be thrown during transformation
match(
result.stderr,
/TypeScript parameter property is not supported in strip-only mode/
result.stderr,
/TypeScript parameter property is not supported in strip-only mode/
);
strictEqual(result.stdout, '');
strictEqual(result.code, 1);
Expand Down

0 comments on commit 5c4f180

Please sign in to comment.