Skip to content

Commit 93d9d8d

Browse files
committed
Fix chai test assertion library usages
1 parent c2866e1 commit 93d9d8d

7 files changed

+26
-6
lines changed

test/featureTests/assets.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ import {
1515
updateJsonWithComments,
1616
} from '../../src/shared/assets';
1717
import { parse } from 'jsonc-parser';
18-
import { should } from 'chai';
18+
import { use, should } from 'chai';
19+
import * as chaiString from 'chai-string';
1920
import { ProjectDebugInformation } from '../../src/shared/IWorkspaceDebugInformationProvider';
2021
import { findNetCoreTargetFramework } from '../../src/shared/utils';
2122
import { isNotNull } from '../testUtil';
2223

24+
use(chaiString);
25+
2326
suite('Asset generation: csproj', () => {
2427
suiteSetup(() => should());
2528

test/integrationTests/completionProvider.integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import OmniSharpCompletionProvider from '../../src/features/completionProvider';
77
import * as vscode from 'vscode';
88
import testAssetWorkspace from './testAssets/testAssetWorkspace';
99
import * as path from 'path';
10-
import { expect, should } from 'chai';
10+
import { use, expect, should } from 'chai';
11+
import * as chaiArray from 'chai-arrays';
1112
import { activateCSharpExtension, isRazorWorkspace, isSlnWithGenerator } from './integrationHelpers';
1213

14+
use(chaiArray);
15+
1316
suite(`${OmniSharpCompletionProvider.name}: Returns the completion items`, () => {
1417
let fileUri: vscode.Uri;
1518

test/integrationTests/documentationCommentAutoFormatting.integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { expect, should } from 'chai';
6+
import { use, expect, should } from 'chai';
7+
import * as chaiArray from 'chai-arrays';
78
import * as vscode from 'vscode';
89
import * as path from 'path';
910
import { isRazorWorkspace, isSlnWithGenerator } from './integrationHelpers';
1011
import testAssetWorkspace from './testAssets/testAssetWorkspace';
1112

13+
use(chaiArray);
14+
1215
const onTypeFormatProviderCommand = 'vscode.executeFormatOnTypeProvider';
1316

1417
function normalizeNewlines(original: string): string {

test/unitTests/logging/dotnetTestLoggerObserver.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as chai from 'chai';
7+
import * as chaiString from 'chai-string';
78
import { getNullChannel } from '../testAssets/fakes';
89
import {
910
EventWithMessage,
@@ -24,6 +25,7 @@ import DotNetTestLoggerObserver from '../../../src/observers/dotnetTestLoggerObs
2425
import * as protocol from '../../../src/omnisharp/protocol';
2526

2627
const expect = chai.expect;
28+
chai.use(chaiString);
2729

2830
suite(`${DotNetTestLoggerObserver.name}`, () => {
2931
let appendedMessage: string;

test/unitTests/logging/omnisharpDebugModeLoggerObserver.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
import { should, expect } from 'chai';
5+
import { use, should, expect } from 'chai';
6+
import * as chaiString from 'chai-string';
67
import { getNullChannel } from '../testAssets/fakes';
78
import {
89
OmnisharpServerVerboseMessage,
@@ -17,6 +18,8 @@ import {
1718
} from '../../../src/omnisharp/loggingEvents';
1819
import { OmnisharpDebugModeLoggerObserver } from '../../../src/observers/omnisharpDebugModeLoggerObserver';
1920

21+
use(chaiString);
22+
2023
suite('OmnisharpDebugModeLoggerObserver', () => {
2124
suiteSetup(() => should());
2225
let logOutput = '';

test/unitTests/logging/telemetryObserver.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
import { should, expect } from 'chai';
5+
import { use, should, expect } from 'chai';
6+
import * as chaiArray from 'chai-arrays';
67
import { TelemetryObserver } from '../../../src/observers/telemetryObserver';
78
import { PlatformInformation } from '../../../src/shared/platform';
89
import {
@@ -22,6 +23,8 @@ import { Package } from '../../../src/packageManager/package';
2223
import { PackageError } from '../../../src/packageManager/packageError';
2324
import { isNotNull } from '../../testUtil';
2425

26+
use(chaiArray);
27+
2528
suite('TelemetryReporterObserver', () => {
2629
suiteSetup(() => should());
2730
const platformInfo = new PlatformInformation('linux', 'architecture');

test/unitTests/parsedEnvironmentFile.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { ParsedEnvironmentFile } from '../../src/coreclrDebug/parsedEnvironmentFile';
7-
import { should, expect } from 'chai';
7+
import { use, should, expect } from 'chai';
8+
import * as chaiString from 'chai-string';
9+
10+
use(chaiString);
811

912
suite('ParsedEnvironmentFile', () => {
1013
suiteSetup(() => should());

0 commit comments

Comments
 (0)