Skip to content

Commit 042e7e9

Browse files
authored
reintroduce linter-worker test (#562)
1 parent 5b76c29 commit 042e7e9

3 files changed

Lines changed: 11 additions & 32 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CYPHER 5 MATCH (n) RETURN m

packages/vscode-extension/tests/fixtures/subquery-call.cypher

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

packages/vscode-extension/tests/specs/api/versionSpecificLinting.spec.ts

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { after, before } from 'mocha';
1313
// Because the VSCode debugger seems to sandbox the editor
1414
// it spins up, so globalStorage is a temp folder, not the
1515
// one getExtensionContext().globalStorageUri returns
16-
suite.skip('Neo4j version specific linting spec', () => {
16+
suite('Neo4j version specific linting spec', () => {
1717
before(async () => {
1818
process.env.LINTER_SWITCHING_TESTS = 'true';
1919
// We need to reconnect to neo4j so that the switching
@@ -33,7 +33,7 @@ suite.skip('Neo4j version specific linting spec', () => {
3333
});
3434

3535
async function testNeo4jSpecificLinting() {
36-
const textFile = 'subquery-call.cypher';
36+
const textFile = 'cypher-versioned.cypher';
3737
const docUri = getDocumentUri(textFile);
3838
await openDocument(docUri);
3939

@@ -42,27 +42,11 @@ suite.skip('Neo4j version specific linting spec', () => {
4242
expected: [
4343
new vscode.Diagnostic(
4444
new vscode.Range(
45-
new vscode.Position(1, 0),
46-
new vscode.Position(4, 1),
45+
new vscode.Position(0, 26),
46+
new vscode.Position(0, 27),
4747
),
48-
'CALL subquery without a variable scope clause is now deprecated. Use CALL (n) { ... }',
49-
vscode.DiagnosticSeverity.Warning,
50-
),
51-
new vscode.Diagnostic(
52-
new vscode.Range(
53-
new vscode.Position(5, 7),
54-
new vscode.Position(5, 9),
55-
),
56-
'Function id is deprecated. Alternative: elementId or an application-generated id',
57-
vscode.DiagnosticSeverity.Warning,
58-
),
59-
new vscode.Diagnostic(
60-
new vscode.Range(
61-
new vscode.Position(5, 7),
62-
new vscode.Position(5, 12),
63-
),
64-
"The query used a deprecated function. ('id' has been replaced by 'elementId or an application-generated id')",
65-
vscode.DiagnosticSeverity.Warning,
48+
'Variable `m` not defined',
49+
vscode.DiagnosticSeverity.Error,
6650
),
6751
],
6852
});
@@ -73,11 +57,11 @@ suite.skip('Neo4j version specific linting spec', () => {
7357
expected: [
7458
new vscode.Diagnostic(
7559
new vscode.Range(
76-
new vscode.Position(5, 7),
77-
new vscode.Position(5, 12),
60+
new vscode.Position(0, 0),
61+
new vscode.Position(0, 6),
7862
),
79-
'The query used a deprecated function: `id`.',
80-
vscode.DiagnosticSeverity.Warning,
63+
'Expected any of ALTER, CALL, CREATE, DEALLOCATE, DELETE, DENY, DETACH, DROP, DRYRUN, ENABLE, EXPLAIN, FINISH, FOREACH, GRANT, INSERT, LOAD, MATCH, MERGE, NODETACH, OPTIONAL, PROFILE, REALLOCATE, REMOVE, RENAME, RETURN, REVOKE, SET, SHOW, START, STOP, TERMINATE, UNWIND, USE, USING or WITH',
64+
vscode.DiagnosticSeverity.Error,
8165
),
8266
],
8367
});

0 commit comments

Comments
 (0)