Skip to content

Commit

Permalink
chore: move test to validator
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Dec 9, 2024
1 parent c87a370 commit 63ebfc2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 23 deletions.

This file was deleted.

This file was deleted.

22 changes: 7 additions & 15 deletions packages/svelte/tests/compiler-errors/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ import { suite, type BaseTest } from '../suite';
import { read_file } from '../helpers.js';

interface CompilerErrorTest extends BaseTest {
error:
| {
code: string;
message: string;
position?: [number, number];
}
| false;
error: {
code: string;
message: string;
position?: [number, number];
};
}

const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
Expand All @@ -27,9 +25,6 @@ const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
generate: 'client'
});
} catch (e) {
if (config.error === false) {
assert.fail('Unexpected error');
}
const error = e as CompileError;

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

if (config.error !== false && !caught_error) {
if (!caught_error) {
assert.fail('Expected an error');
}
}
Expand All @@ -55,9 +50,6 @@ const { test, run } = suite<CompilerErrorTest>((config, cwd) => {
generate: 'client'
});
} catch (e) {
if (config.error === false) {
assert.fail('Unexpected error');
}
const error = e as CompileError;

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

if (config.error !== false && !caught_error) {
if (!caught_error) {
assert.fail('Expected an error');
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script module>
export { something } from "./something.js";
</script>

0 comments on commit 63ebfc2

Please sign in to comment.