use sourceType script instead of module when testing noDeleteVars
MODIFY
packages/@romejs/js-compiler/__rtests__/lint.ts
packages/@romejs/js-compiler/__rtests__/lint.ts
@@ -257,7 +257,7 @@ test('disallow var', async t => {
]);
});
-test.only('no delete vars', async t => {
+test('no delete vars', async t => {
const res = await testLint(
`
const foo = "test";
@@ -267,9 +267,8 @@ test.only('no delete vars', async t => {
'script',
);
- console.log(res.diagnostics);
-
- t.looksLike(res.diagnostics[1], {
+ t.looksLike(res.diagnostics, [
+ {
category: 'lint/noDeleteVars',
message: 'Variables should not be deleted.',
mtime: undefined,
@@ -277,7 +276,8 @@ test.only('no delete vars', async t => {
start: {index: 29, line: 3, column: 4},
end: {index: 39, line: 3, column: 14},
language: 'js',
- sourceType: 'module',
+ sourceType: 'script',
origins: [{category: 'lint'}],
- });
+ },
+ ]);
});

use sourceType script instead of module when testing noDeleteVars