Skip to content

Commit 63ebfc2

Browse files
committed
chore: move test to validator
1 parent c87a370 commit 63ebfc2

File tree

5 files changed

+11
-23
lines changed

5 files changed

+11
-23
lines changed

packages/svelte/tests/compiler-errors/samples/export-not-defined-module-with-source/_config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/svelte/tests/compiler-errors/samples/export-not-defined-module-with-source/main.svelte

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/svelte/tests/compiler-errors/test.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ import { suite, type BaseTest } from '../suite';
55
import { read_file } from '../helpers.js';
66

77
interface CompilerErrorTest extends BaseTest {
8-
error:
9-
| {
10-
code: string;
11-
message: string;
12-
position?: [number, number];
13-
}
14-
| false;
8+
error: {
9+
code: string;
10+
message: string;
11+
position?: [number, number];
12+
};
1513
}
1614

1715
const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
@@ -27,9 +25,6 @@ const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
2725
generate: 'client'
2826
});
2927
} catch (e) {
30-
if (config.error === false) {
31-
assert.fail('Unexpected error');
32-
}
3328
const error = e as CompileError;
3429

3530
caught_error = true;
@@ -42,7 +37,7 @@ const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
4237
}
4338
}
4439

45-
if (config.error !== false && !caught_error) {
40+
if (!caught_error) {
4641
assert.fail('Expected an error');
4742
}
4843
}
@@ -55,9 +50,6 @@ const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
5550
generate: 'client'
5651
});
5752
} catch (e) {
58-
if (config.error === false) {
59-
assert.fail('Unexpected error');
60-
}
6153
const error = e as CompileError;
6254

6355
caught_error = true;
@@ -70,7 +62,7 @@ const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
7062
}
7163
}
7264

73-
if (config.error !== false && !caught_error) {
65+
if (!caught_error) {
7466
assert.fail('Expected an error');
7567
}
7668
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script module>
2+
export { something } from "./something.js";
3+
</script>

0 commit comments

Comments
 (0)