From 16a8b19eff0ae34b3be1dc9546386790063e0dbb Mon Sep 17 00:00:00 2001 From: Dan Harper Date: Sun, 2 Apr 2017 16:10:34 -0700 Subject: [PATCH] fix uncalled matchers (#3027) --- __tests__/commands/add.js | 6 +++--- __tests__/commands/install/integration.js | 6 +++--- __tests__/commands/outdated.js | 2 +- __tests__/normalize-manifest.js | 2 +- __tests__/reporters/console-reporter.js | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/__tests__/commands/add.js b/__tests__/commands/add.js index cd40c4471f..20637745c1 100644 --- a/__tests__/commands/add.js +++ b/__tests__/commands/add.js @@ -430,13 +430,13 @@ test.concurrent('upgrade scenario', (): Promise => { 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'); }); }); diff --git a/__tests__/commands/install/integration.js b/__tests__/commands/install/integration.js index 70fb99fd05..d458d61b9b 100644 --- a/__tests__/commands/install/integration.js +++ b/__tests__/commands/install/integration.js @@ -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); }); }); @@ -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 => { 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); }); }); diff --git a/__tests__/commands/outdated.js b/__tests__/commands/outdated.js index 18abcaa755..cb0f1ed127 100644 --- a/__tests__/commands/outdated.js +++ b/__tests__/commands/outdated.js @@ -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); }, ); }); diff --git a/__tests__/normalize-manifest.js b/__tests__/normalize-manifest.js index 7aec708854..75609cb4bb 100644 --- a/__tests__/normalize-manifest.js +++ b/__tests__/normalize-manifest.js @@ -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(' ')).toEqual({email: 'sebmck@gmail.com'}); expect(util.parsePerson('Sebastian McKenzie ')).toEqual({name: 'Sebastian McKenzie', email: 'sebmck@gmail.com'}); diff --git a/__tests__/reporters/console-reporter.js b/__tests__/reporters/console-reporter.js index 4f5eaae2e4..75fbe6865f 100644 --- a/__tests__/reporters/console-reporter.js +++ b/__tests__/reporters/console-reporter.js @@ -129,7 +129,7 @@ test('ConsoleReporter.select', async () => { name: 'bar', value: 'bar', }]); - expect(res, 'foo'); + expect(res).toBe('foo'); })).toMatchSnapshot(); });