Skip to content

Commit

Permalink
Change how the advisor object is imported in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubfijalkowski committed Oct 24, 2018
1 parent 3080763 commit b5bd9b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/omnisharp/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Options {
const razorDevMode = !!razorConfig && razorConfig.get<boolean>('devmode', false);
const razorPluginPath = razorConfig ? razorConfig.get<string>('plugin.path', undefined) : undefined;

const maxProjectFileCountForDiagnosticAnalysis = csharpConfig.get<number>('maxProjectFileCountForDiagnosticAnalysis', 1000);
const maxProjectFileCountForDiagnosticAnalysis = csharpConfig.get<number | null>('maxProjectFileCountForDiagnosticAnalysis', 1000);

return new Options(
path,
Expand Down
14 changes: 7 additions & 7 deletions test/integrationTests/diagnostics.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as path from 'path';
import { activateCSharpExtension } from './integrationHelpers';
import testAssetWorkspace from './testAssets/testAssetWorkspace';

import { advisor } from "../../src/omnisharp/extension";
import * as OmniSharp from "../../src/omnisharp/extension";

const chai = require('chai');
chai.use(require('chai-arrays'));
Expand Down Expand Up @@ -39,36 +39,36 @@ suite(`Diagnostics Provider ${testAssetWorkspace.description}`, function () {
test('Reports errors from whole project when maxProjectFileCountForDiagnosticAnalysis is higher than the file count', async () => {
await setLimit(1000);

expect(advisor.shouldValidateProject()).to.be.true;
expect(OmniSharp.advisor.shouldValidateProject()).to.be.true;
});

test('Reports errors from individual files when maxProjectFileCountForDiagnosticAnalysis is higher than the file count', async () => {
await setLimit(1000);

expect(advisor.shouldValidateFiles()).to.be.true;
expect(OmniSharp.advisor.shouldValidateFiles()).to.be.true;
});

test('Does not report errors from whole project when maxProjectFileCountForDiagnosticAnalysis is lower than the file count', async () => {
await setLimit(1);

expect(advisor.shouldValidateProject()).to.be.false;
expect(OmniSharp.advisor.shouldValidateProject()).to.be.false;
});

test('Reports errors from individual files when maxProjectFileCountForDiagnosticAnalysis is lower than the file count', async () => {
await setLimit(1);

expect(advisor.shouldValidateFiles()).to.be.true;
expect(OmniSharp.advisor.shouldValidateFiles()).to.be.true;
});

test('Reports errors from whole project when maxProjectFileCountForDiagnosticAnalysis is null', async () => {
await setLimit(null);

expect(advisor.shouldValidateProject()).to.be.true;
expect(OmniSharp.advisor.shouldValidateProject()).to.be.true;
});

test('Reports errors from individual files when maxProjectFileCountForDiagnosticAnalysis is null', async () => {
await setLimit(null);

expect(advisor.shouldValidateFiles()).to.be.true;
expect(OmniSharp.advisor.shouldValidateFiles()).to.be.true;
});
});

0 comments on commit b5bd9b2

Please sign in to comment.