Skip to content

Commit

Permalink
fix uncalled matchers (#3027)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelypuppy0607 committed Apr 2, 2017
1 parent 1b26a76 commit ca92c47
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions __tests__/commands/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,13 @@ test.concurrent('upgrade scenario', (): Promise<void> => {
const lockFileLines2 = explodeLockfile(lockFileWritten2);
expect(lockFileLines2).toHaveLength(3);
expect(lockFileLines2[0]).toEqual('left-pad@1.1.0:');
expect(lockFileLines2[2].match(
expect(lockFileLines2[2]).toMatch(
/resolved "https:\/\/registry\.yarnpkg\.com\/left-pad\/-\/left-pad-1.1.0.tgz#[a-f0-9]+"/,
));
);

const mirror2 = await fs.walk(path.join(config.cwd, mirrorPath));
expect(mirror2).toHaveLength(2);
expect(mirror2[1].relative, 'left-pad-1.1.0.tgz');
expect(mirror2[1].relative).toBe('left-pad-1.1.0.tgz');
});
});

Expand Down
6 changes: 3 additions & 3 deletions __tests__/commands/install/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,14 +794,14 @@ test.concurrent('install should not continue if integrity check passes', (): Pro
let reinstall = new Install({}, config, reporter, await Lockfile.fromDirectory(config.cwd));
await reinstall.init();

expect(await fs.exists(path.join(config.cwd, 'node_modules', 'yarn.test')));
expect(await fs.exists(path.join(config.cwd, 'node_modules', 'yarn.test'))).toBe(true);

await fs.unlink(path.join(config.cwd, 'node_modules', 'yarn.test'));

reinstall = new Install({}, config, reporter, await Lockfile.fromDirectory(config.cwd));
await reinstall.init();

expect(!await fs.exists(path.join(config.cwd, 'node_modules', 'yarn.test')));
expect(await fs.exists(path.join(config.cwd, 'node_modules', 'yarn.test'))).toBe(false);

});
});
Expand Down Expand Up @@ -842,7 +842,7 @@ test.concurrent('install should not rewrite lockfile with no substantial changes

test.concurrent('lockfile should be created when missing even if integrity matches', (): Promise<void> => {
return runInstall({}, 'lockfile-missing', async (config, reporter) => {
expect(await fs.exists(path.join(config.cwd, 'yarn.lock')));
expect(await fs.exists(path.join(config.cwd, 'yarn.lock'))).toBe(true);
});
});

Expand Down
2 changes: 1 addition & 1 deletion __tests__/commands/outdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ test.concurrent('shows when wanted > current and current > latest', (): Promise<

expect(json.data.body.length).toBe(1);
expect(json.data.body[0][0]).toBe('webpack');
expect(semver.lt(json.data.body[0][1], json.data.body[0][2]));
expect(semver.lt(json.data.body[0][1], json.data.body[0][2])).toBe(true);
},
);
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/normalize-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ test('util.stringifyPerson', () => {
});

test('util.parsePerson', () => {
expect(util.parsePerson({}), {});
expect(util.parsePerson({})).toEqual({});
expect(util.parsePerson('Sebastian McKenzie')).toEqual({name: 'Sebastian McKenzie'});
expect(util.parsePerson(' <sebmck@gmail.com>')).toEqual({email: 'sebmck@gmail.com'});
expect(util.parsePerson('Sebastian McKenzie <sebmck@gmail.com>')).toEqual({name: 'Sebastian McKenzie', email: 'sebmck@gmail.com'});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/reporters/console-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ test('ConsoleReporter.select', async () => {
name: 'bar',
value: 'bar',
}]);
expect(res, 'foo');
expect(res).toBe('foo');
})).toMatchSnapshot();
});

Expand Down

0 comments on commit ca92c47

Please sign in to comment.