Skip to content

Commit 1c4f90f

Browse files
committed
test(editor): add test for nested config serverity (#10697)
1 parent c48f6ae commit 1c4f90f

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

editors/vscode/client/extension.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,4 +327,18 @@ suite('E2E Diagnostics', () => {
327327

328328
strictEqual(contentWithFixAll.toString(), 'if (foo === null) { bar();}');
329329
});
330+
331+
test('nested configs severity', async () => {
332+
await loadFixture('nested_config');
333+
const rootDiagnostics = await getDiagnostics('index.ts');
334+
const nestedDiagnostics = await getDiagnostics('folder/index.ts');
335+
336+
assert(typeof rootDiagnostics[0].code == 'object');
337+
strictEqual(rootDiagnostics[0].code.target.authority, 'oxc.rs');
338+
strictEqual(rootDiagnostics[0].severity, DiagnosticSeverity.Warning);
339+
340+
assert(typeof nestedDiagnostics[0].code == 'object');
341+
strictEqual(nestedDiagnostics[0].code.target.authority, 'oxc.rs');
342+
strictEqual(nestedDiagnostics[0].severity, DiagnosticSeverity.Error);
343+
});
330344
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-debugger": "warn"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"no-debugger": "error"
4+
}
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
debugger;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
debugger;

0 commit comments

Comments
 (0)