Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
markis committed Jan 17, 2018
1 parent fb56f93 commit e5d3ac5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"coverageThreshold": {
"global": {
"branches": 100,
"functions": ,
"lines": ,
"statements":
"functions": 75,
"lines": 75,
"statements": 75
}
},
"reporters": [
Expand Down
10 changes: 3 additions & 7 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ const mockConfig = {
rootDir: './example',
};

jest.mock('fs');
process.cwd = jest.fn().mockReturnValue(resolve('./example'));

describe('jest-ratchet', () => {
beforeAll(() => {
jest.mock('fs');
process.cwd = jest.fn().mockReturnValue(resolve('./example'));
});
afterAll(() => {
jest.unmock('fs');
});

it('will initialize without error', () => {
const config = {
Expand Down
2 changes: 2 additions & 0 deletions src/json.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const mockThreshold = {
},
};

jest.mock('fs');

describe('json', () => {
it('will ratchet percents', () => {
const json = `
Expand Down

0 comments on commit e5d3ac5

Please sign in to comment.