Skip to content

Commit

Permalink
refactor: do not use deprecated 'assert.equal' method
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmlnc committed May 6, 2021
1 parent 0d85018 commit 36cf77c
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 97 deletions.
10 changes: 5 additions & 5 deletions src/unsafe/test/e2e/suite/completion/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ export async function testCompletion(
return;
}

assert.equal(match.label, ei.label);
assert.strictEqual(match.label, ei.label);
if (ei.kind) {
assert.equal(match.kind, ei.kind);
assert.strictEqual(match.kind, ei.kind);
}
if (ei.detail) {
assert.equal(match.detail, ei.detail);
assert.strictEqual(match.detail, ei.detail);
}

if (ei.documentation) {
if (typeof match.documentation === 'string') {
assert.equal(match.documentation, ei.documentation);
assert.strictEqual(match.documentation, ei.documentation);
} else {
if (ei.documentation && (ei.documentation as MarkupContent).value && match.documentation) {
assert.equal(
assert.strictEqual(
(match.documentation as vscode.MarkdownString).value,
(ei.documentation as MarkupContent).value
);
Expand Down
2 changes: 1 addition & 1 deletion src/unsafe/test/e2e/suite/definition/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export async function testDefinition(docUri: vscode.Uri, position: vscode.Positi
}

assert.ok(result[0].range.isEqual(expectedLocation.range));
assert.equal(result[0].uri.fsPath, expectedLocation.uri.fsPath);
assert.strictEqual(result[0].uri.fsPath, expectedLocation.uri.fsPath);
}
10 changes: 5 additions & 5 deletions src/unsafe/test/e2e/suite/signature/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export async function testSignature(docUri: vscode.Uri, position: vscode.Positio
assert.fail("The 'result' is undefined.");
}

assert.equal(result.activeParameter, signature.activeParameter, 'activeParameter');
assert.equal(result.activeSignature, signature.activeSignature, 'activeSignature');
assert.strictEqual(result.activeParameter, signature.activeParameter, 'activeParameter');
assert.strictEqual(result.activeSignature, signature.activeSignature, 'activeSignature');

assert.equal(
assert.strictEqual(
result.signatures.length,
signature.signatures.length,
`Count of signatures: ${signature.signatures.length} expected; ${result.signatures.length} actual`
Expand All @@ -33,9 +33,9 @@ export async function testSignature(docUri: vscode.Uri, position: vscode.Positio
assert.fail("The 'actualSignature' is undefined.");
}

assert.equal(actualSignature.label, expectedSignature.label);
assert.strictEqual(actualSignature.label, expectedSignature.label);

assert.equal(
assert.strictEqual(
actualSignature.parameters.length,
expectedSignature.parameters.length,
`Count of parameters for {expectedSignature.label}: ${expectedSignature.parameters.length} expected; ${actualSignature.parameters.length} actual`
Expand Down
34 changes: 17 additions & 17 deletions src/unsafe/test/providers/completion.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,33 @@ describe('Providers/Completion - Basic', () => {
it('Variables', async () => {
const actual = await getCompletionList(['$|']);

assert.equal(actual?.items.length, 5);
assert.strictEqual(actual?.items.length, 5);
});

it('Mixins', async () => {
const actual = await getCompletionList(['@include |']);

assert.equal(actual?.items.length, 1);
assert.strictEqual(actual?.items.length, 1);
});
});

describe('Providers/Completion - Context', async () => {
it('Empty property value', async () => {
const actual = await getCompletionList(['.a { content: | }']);

assert.equal(actual?.items.length, 5);
assert.strictEqual(actual?.items.length, 5);
});

it('Non-empty property value without suggestions', async () => {
const actual = await getCompletionList(['.a { background: url(../images/one|.png); }']);

assert.equal(actual?.items.length, 0);
assert.strictEqual(actual?.items.length, 0);
});

it('Non-empty property value with Variables', async () => {
const actual = await getCompletionList(['.a { background: url(../images/#{$one|}/one.png); }']);

assert.equal(actual?.items.length, 5);
assert.strictEqual(actual?.items.length, 5);
});

it('Discard suggestions inside quotes', async () => {
Expand All @@ -80,60 +80,60 @@ describe('Providers/Completion - Context', async () => {
'}'
]);

assert.equal(actual?.items.length, 0);
assert.strictEqual(actual?.items.length, 0);
});

it('Custom value for `suggestFunctionsInStringContextAfterSymbols` option', async () => {
const actual = await getCompletionList(['.a { background: url(../images/m|'], {
suggestFunctionsInStringContextAfterSymbols: '/'
});

assert.equal(actual?.items.length, 1);
assert.strictEqual(actual?.items.length, 1);
});

it('Discard suggestions inside single-line comments', async () => {
const actual = await getCompletionList(['// $|']);

assert.equal(actual?.items.length, 0);
assert.strictEqual(actual?.items.length, 0);
});

it('Discard suggestions inside block comments', async () => {
const actual = await getCompletionList(['/* $| */']);

assert.equal(actual?.items.length, 0);
assert.strictEqual(actual?.items.length, 0);
});

it('Identify color variables', async () => {
const actual = await getCompletionList(['$|']);

assert.equal(actual?.items[0]?.kind, CompletionItemKind.Variable);
assert.equal(actual?.items[1]?.kind, CompletionItemKind.Variable);
assert.equal(actual?.items[2]?.kind, CompletionItemKind.Color);
assert.equal(actual?.items[3]?.kind, CompletionItemKind.Color);
assert.equal(actual?.items[4]?.kind, CompletionItemKind.Color);
assert.strictEqual(actual?.items[0]?.kind, CompletionItemKind.Variable);
assert.strictEqual(actual?.items[1]?.kind, CompletionItemKind.Variable);
assert.strictEqual(actual?.items[2]?.kind, CompletionItemKind.Color);
assert.strictEqual(actual?.items[3]?.kind, CompletionItemKind.Color);
assert.strictEqual(actual?.items[4]?.kind, CompletionItemKind.Color);
});
});

describe('Providers/Completion - Implicitly', () => {
it('Show default implicitly label', async () => {
const actual = await getCompletionList(['$|']);

assert.equal(actual?.items[0]?.detail, '(implicitly) one.scss');
assert.strictEqual(actual?.items[0]?.detail, '(implicitly) one.scss');
});

it('Show custom implicitly label', async () => {
const actual = await getCompletionList(['$|'], {
implicitlyLabel: '👻'
});

assert.equal(actual?.items[0]?.detail, '👻 one.scss');
assert.strictEqual(actual?.items[0]?.detail, '👻 one.scss');
});

it('Hide implicitly label', async () => {
const actual = await getCompletionList(['$|'], {
implicitlyLabel: null
});

assert.equal(actual?.items[0]?.detail, 'one.scss');
assert.strictEqual(actual?.items[0]?.detail, 'one.scss');
});
});
10 changes: 5 additions & 5 deletions src/unsafe/test/providers/goDefinition.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Providers/GoDefinition', () => {

const actual = await goDefinition(document, 2, storage);

assert.equal(actual, null);
assert.strictEqual(actual, null);
});

it('doGoDefinition - Mixins', async () => {
Expand All @@ -65,15 +65,15 @@ describe('Providers/GoDefinition', () => {

const actual = await goDefinition(document, 8, storage);

assert.equal(actual, null);
assert.strictEqual(actual, null);
});

it('doGoDefinition - Mixin Arguments', async () => {
const document = helpers.makeDocument('@mixin mixin($a) {}');

const actual = await goDefinition(document, 10, storage);

assert.equal(actual, null);
assert.strictEqual(actual, null);
});

it('doGoDefinition - Functions', async () => {
Expand All @@ -93,14 +93,14 @@ describe('Providers/GoDefinition', () => {

const actual = await goDefinition(document, 8, storage);

assert.equal(actual, null);
assert.strictEqual(actual, null);
});

it('doGoDefinition - Function Arguments', async () => {
const document = helpers.makeDocument('@function make($a) {}');

const actual = await goDefinition(document, 13, storage);

assert.equal(actual, null);
assert.strictEqual(actual, null);
});
});
Loading

0 comments on commit 36cf77c

Please sign in to comment.