Skip to content

Commit

Permalink
test: added unit test to maintain coverage.
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
Ross Knudsen committed May 17, 2020
1 parent 0d7d043 commit f879e56
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/__tests__/settings.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,26 @@ describe('getSettings', () => {
);
});

it('setting pathToJest updates jestCommandLine', () => {
const localJestMajorVersion = 1000;
const pathToConfig = 'test';
const jestCommandLine = 'path_to_jest';
const rootPath = 'root_path';
const workspace = new ProjectWorkspace(rootPath, jestCommandLine, pathToConfig, localJestMajorVersion);

// first check that both pathToConfig and jestCommandLine are the same value.
expect(workspace.jestCommandLine).toBe(jestCommandLine);
expect(workspace.pathToJest).toBe(jestCommandLine);

// then update the pathToJest property.
const updatedPathToJest = 'updated pathToJest';
workspace.pathToJest = updatedPathToJest;

// check that both pathToConfig and jestCommandLine yield the same value.
expect(workspace.jestCommandLine).toBe(updatedPathToJest);
expect(workspace.pathToJest).toBe(updatedPathToJest);
});

describe('parse config', () => {
const workspace = new ProjectWorkspace('root_path', 'path_to_jest', 'test', 1000);

Expand Down

0 comments on commit f879e56

Please sign in to comment.