Skip to content

Commit ecd0834

Browse files
committed
test: fix TS transform tests that rely on source maps
1 parent 4842090 commit ecd0834

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

test/es-module/test-typescript-transform.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { skip, spawnPromisified } from '../common/index.mjs';
1+
import { isInsideDirWithUnusualChars, skip, spawnPromisified } from '../common/index.mjs';
22
import * as fixtures from '../common/fixtures.mjs';
33
import { match, strictEqual } from 'node:assert';
44
import { test } from 'node:test';
55

66
if (!process.config.variables.node_use_amaro) skip('Requires Amaro');
77

8+
const maybeSkip = { skip: isInsideDirWithUnusualChars };
9+
810
test('execute a TypeScript file with transformation enabled', async () => {
911
const result = await spawnPromisified(process.execPath, [
1012
'--experimental-transform-types',
@@ -17,7 +19,7 @@ test('execute a TypeScript file with transformation enabled', async () => {
1719
strictEqual(result.code, 0);
1820
});
1921

20-
test('reconstruct error of a TypeScript file with transformation enabled and sourcemaps', async () => {
22+
test('reconstruct error of a TypeScript file with transformation enabled and sourcemaps', maybeSkip, async () => {
2123
const result = await spawnPromisified(process.execPath, [
2224
'--experimental-transform-types',
2325
'--no-warnings',
@@ -29,7 +31,7 @@ test('reconstruct error of a TypeScript file with transformation enabled and sou
2931
strictEqual(result.code, 1);
3032
});
3133

32-
test('reconstruct error of a TypeScript file with transformation enabled without sourcemaps', async () => {
34+
test('reconstruct error of a TypeScript file with transformation enabled without sourcemaps', maybeSkip, async () => {
3335
const result = await spawnPromisified(process.execPath, [
3436
'--experimental-transform-types',
3537
'--no-enable-source-maps',
@@ -102,7 +104,7 @@ test('execute a TypeScript file with modern typescript syntax', async () => {
102104
strictEqual(result.code, 0);
103105
});
104106

105-
test('execute a transpiled JavaScript file', async () => {
107+
test('execute a transpiled JavaScript file', maybeSkip, async () => {
106108
const result = await spawnPromisified(process.execPath, [
107109
'--enable-source-maps',
108110
'--no-warnings',

test/parallel/test-util-getcallsites.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const assert = require('node:assert');
115115
Error.stackTraceLimit = originalStackTraceLimit;
116116
}
117117

118-
{
118+
if (!common.isInsideDirWithUnusualChars) {
119119
const { status, stderr, stdout } = spawnSync(process.execPath, [
120120
'--no-warnings',
121121
'--experimental-transform-types',
@@ -130,7 +130,7 @@ const assert = require('node:assert');
130130
assert.strictEqual(status, 0);
131131
}
132132

133-
{
133+
if (!common.isInsideDirWithUnusualChars) {
134134
const { status, stderr, stdout } = spawnSync(process.execPath, [
135135
'--no-warnings',
136136
'--experimental-transform-types',
@@ -147,7 +147,7 @@ const assert = require('node:assert');
147147
assert.strictEqual(status, 0);
148148
}
149149

150-
{
150+
if (!common.isInsideDirWithUnusualChars) {
151151
// Source maps should be disabled when options.sourceMap is false
152152
const { status, stderr, stdout } = spawnSync(process.execPath, [
153153
'--no-warnings',

0 commit comments

Comments
 (0)