Skip to content

Commit

Permalink
build(deps-dev): bump eslint-plugin-jest from 22.5.1 to 23.8.1
Browse files Browse the repository at this point in the history
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 22.5.1 to 23.8.1.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](jest-community/eslint-plugin-jest@v22.5.1...v23.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
  • Loading branch information
dependabot-preview[bot] authored and michaelsbradleyjr committed Mar 5, 2020
1 parent 7b47107 commit a362365
Show file tree
Hide file tree
Showing 24 changed files with 160 additions and 104 deletions.
2 changes: 1 addition & 1 deletion packages/core/code-runner/package.json
Expand Up @@ -73,7 +73,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/core/code-runner/test/code-runner.spec.js
Expand Up @@ -3,6 +3,8 @@ import sinon from 'sinon';
import { fakeEmbark } from 'embark-testing';
import CodeRunner from '../src/';

/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["assert", "expect"] }] */

// Due to our `DAPP_PATH` dependency in `embark-utils` `dappPath()`, we need to
// ensure that this environment variable is defined.
process.env.DAPP_PATH = 'something';
Expand Down Expand Up @@ -40,5 +42,6 @@ describe('core/code-runner', () => {
// `runcode:eval` throws a `ReferenceError` if `testVar` wasn't registered
// in the VM.
await embark.events.request2('runcode:eval', `testVar.foo = 'bar';`);
assert(true);
});
});
2 changes: 1 addition & 1 deletion packages/core/console/package.json
Expand Up @@ -69,7 +69,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down
20 changes: 11 additions & 9 deletions packages/core/console/test/console.spec.js
@@ -1,17 +1,17 @@
import assert from 'assert';
import { fakeEmbark } from 'embark-testing';

import Console from '../src';
import { version } from '../package.json';

/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["assert", "expect"] }] */

// Due to our `DAPP_PATH` dependency in `embark-utils` `dappPath()`, we need to
// ensure that this environment variable is defined.
process.env.DAPP_PATH = 'something';

describe('core/console', () => {

const { embark } = fakeEmbark();


let console;

beforeEach(() => {
Expand All @@ -28,12 +28,14 @@ describe('core/console', () => {
embark.teardown();
});

it('it should provide a help text', (done) => {
console.executeCmd('help', (_err, output) => {
let lines = output.split('\n');
assert.equal(lines[0], 'Welcome to Embark ' + version);
assert.equal(lines[2], 'possible commands are:');
done();
it('it should provide a help text', () => {
return new Promise(done => {
console.executeCmd('help', (_err, output) => {
let lines = output.split('\n');
assert.equal(lines[0], 'Welcome to Embark ' + version);
assert.equal(lines[2], 'possible commands are:');
done();
});
});
});
});
2 changes: 1 addition & 1 deletion packages/core/logger/package.json
Expand Up @@ -63,7 +63,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/logger/test/logger.spec.js
Expand Up @@ -2,6 +2,8 @@ import assert from 'assert';
import sinon from 'sinon';
import { fakeEmbark } from 'embark-testing';

/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["assert", "expect"] }] */

describe('core/logger', () => {

const { embark } = fakeEmbark();
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/basic-pipeline/package.json
Expand Up @@ -96,7 +96,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/ens/package.json
Expand Up @@ -63,7 +63,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0"
Expand Down
59 changes: 32 additions & 27 deletions packages/plugins/ens/test/index.js
Expand Up @@ -8,7 +8,6 @@ describe('embark-ens', () => {

const { embark } = fakeEmbark();


beforeEach(() => {
embark.events.setCommandHandler('namesystem:node:register', () => {});
embark.config.blockchainConfig = { enabled: true };
Expand All @@ -31,44 +30,50 @@ describe('embark-ens', () => {
embark.teardown();
});

it("should register the right artifact", (done) => {
const pipelineRegisterHandler = jest.fn(async (args, cb) => {
ens.getEnsConfig((err, config) => {
expect(args).toEqual({
path: ['test-dir', 'config'],
file: 'namesystem.json',
format: 'json',
dappAutoEnable: true,
content: Object.assign({}, embark.config.namesystemConfig, config)
it("should register the right artifact", () => {
return new Promise(done => {
const pipelineRegisterHandler = jest.fn((args, cb) => {
ens.getEnsConfig((err, config) => {
expect(args).toEqual({
path: ['test-dir', 'config'],
file: 'namesystem.json',
format: 'json',
dappAutoEnable: true,
content: Object.assign({}, embark.config.namesystemConfig, config)
});
cb();
done();
});
cb();
done();
});
});

embark.events.setCommandHandler('pipeline:register', pipelineRegisterHandler);
embark.events.setCommandHandler('pipeline:register', pipelineRegisterHandler);

ens.addArtifactFile({}, () => {});
ens.addArtifactFile({}, () => {});
});
});

describe('safeRegisterSubDomain', () => {
it('should register if the name is not registered', (done) => {
ens.ensResolve = jest.fn((name, cb) => { cb(null, null); });
ens.registerSubDomain = jest.fn((defaultAccount, subDomainName, reverseNode, address, secureSend, callback) => callback());
it('should register if the name is not registered', () => {
return new Promise(done => {
ens.ensResolve = jest.fn((name, cb) => { cb(null, null); });
ens.registerSubDomain = jest.fn((defaultAccount, subDomainName, reverseNode, address, secureSend, callback) => callback());

ens.safeRegisterSubDomain('test.eth', '0x0123', '0x4321', () => {
expect(ens.registerSubDomain).toHaveBeenCalledWith('0x4321', 'test.eth', '0xd523d7aaff8eefa323a17f2c79662ff1a8d952f6fa9cf53986347e99ada8098c', '0x0123', secureSend, expect.any(Function));
done();
ens.safeRegisterSubDomain('test.eth', '0x0123', '0x4321', () => {
expect(ens.registerSubDomain).toHaveBeenCalledWith('0x4321', 'test.eth', '0xd523d7aaff8eefa323a17f2c79662ff1a8d952f6fa9cf53986347e99ada8098c', '0x0123', secureSend, expect.any(Function));
done();
});
});
});

it('should not register if the name is already registered', (done) => {
ens.ensResolve = jest.fn((name, cb) => { cb(null, '0x0123'); });
ens.registerSubDomain = jest.fn((defaultAccount, subDomainName, reverseNode, address, secureSend, callback) => callback());
it('should not register if the name is already registered', () => {
return new Promise(done => {
ens.ensResolve = jest.fn((name, cb) => { cb(null, '0x0123'); });
ens.registerSubDomain = jest.fn((defaultAccount, subDomainName, reverseNode, address, secureSend, callback) => callback());

ens.safeRegisterSubDomain('test.eth', '0x0123', '0x4321', () => {
expect(ens.registerSubDomain).not.toHaveBeenCalled();
done();
ens.safeRegisterSubDomain('test.eth', '0x0123', '0x4321', () => {
expect(ens.registerSubDomain).not.toHaveBeenCalled();
done();
});
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/scripts-runner/package.json
Expand Up @@ -60,7 +60,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down
68 changes: 40 additions & 28 deletions packages/plugins/scripts-runner/test/script-runner.spec.js
Expand Up @@ -6,6 +6,8 @@ import ScriptsRunnerPlugin, { ScriptsRunnerCommand } from '../src/';
import { file as tmpFile, dir as tmpDir } from 'tmp-promise';
import { promises } from 'fs';

/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["assert", "expect"] }] */

// Due to our `DAPP_PATH` dependency in `embark-utils` `dappPath()`, we need to
// ensure that this environment variable is defined.
process.env.DAPP_PATH = 'something';
Expand Down Expand Up @@ -86,17 +88,19 @@ describe('plugins/scripts-runner', () => {
sinon.restore();
});

it('should execute script', async (done) => {
it('should execute script', async () => {
const scriptFile = await prepareScriptFile(`module.exports = () => { return 'done'; }`);

embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, false, (err, result) => {
assert.equal(result, 'done');
scriptFile.cleanup();
done();
return new Promise(done => {
embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, false, (err, result) => {
assert.equal(result, 'done');
scriptFile.cleanup();
done();
});
});
});

it('should execute all scripts in a directory', async (done) => {
it('should execute all scripts in a directory', async () => {
const scriptsDir = await tmpDir();

// eslint-disable-next-line no-unused-vars
Expand All @@ -111,15 +115,17 @@ describe('plugins/scripts-runner', () => {
scriptsDir.path
);

embark.events.request(ScriptsRunnerCommand.Execute, scriptsDir.path, false, (err, result) => {
assert.ok(result.includes('done'));
assert.ok(result.includes('done2'));
scriptsDir.cleanup();
done();
return new Promise(done => {
embark.events.request(ScriptsRunnerCommand.Execute, scriptsDir.path, false, (err, result) => {
assert.ok(result.includes('done'));
assert.ok(result.includes('done2'));
scriptsDir.cleanup();
done();
});
});
});

it('should force track scripts if --track option is applied', async (done) => {
it('should force track scripts if --track option is applied', async () => {
const scriptFile = await prepareScriptFile(`module.exports = () => { return 'done'; }`);

const expectedResult = {
Expand All @@ -128,16 +134,18 @@ describe('plugins/scripts-runner', () => {
forceTracking: true
};

embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, true, (err, result) => {
assert.equal(result, 'done');
assert(testTracker.track.calledOnce);
assert(testTracker.track.calledWith(expectedResult));
scriptFile.cleanup();
done();
return new Promise(done => {
embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, true, (err, result) => {
assert.equal(result, 'done');
assert(testTracker.track.calledOnce);
assert(testTracker.track.calledWith(expectedResult));
scriptFile.cleanup();
done();
});
});
});

it('should track automatically if script directory equals migrations directory', async (done) => {
it('should track automatically if script directory equals migrations directory', async () => {
const scriptsDir = await tmpDir();
const migrationsDir = path.join(scriptsDir.path, embark.config.embarkConfig.migrations);

Expand All @@ -154,20 +162,24 @@ describe('plugins/scripts-runner', () => {
forceTracking: false
};

embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, false, (err, result) => {
assert.equal(result, 'done');
assert(testTracker.track.calledOnce);
assert(testTracker.track.calledWith(expectedResult));
done();
return new Promise(done => {
embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, false, (err, result) => {
assert.equal(result, 'done');
assert(testTracker.track.calledOnce);
assert(testTracker.track.calledWith(expectedResult));
done();
});
});
});

it('should not execute script if it was tracked', async(done) => {
it('should not execute script if it was tracked', async() => {
const scriptFile = await prepareScriptFile(`module.exports = () => { return 'done'; }`);

embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, true, (err, result) => {
assert.equal(result, undefined);
done();
return new Promise(done => {
embark.events.request(ScriptsRunnerCommand.Execute, scriptFile.path, true, (err, result) => {
assert.equal(result, undefined);
done();
});
});
});
});
2 changes: 1 addition & 1 deletion packages/plugins/snark/package.json
Expand Up @@ -66,7 +66,7 @@
"eslint": "6.8.0",
"eslint-config-prettier": "6.1.0",
"eslint-plugin-import": "2.20.1",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"eslint-plugin-prettier": "3.1.0",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/suggestions/package.json
Expand Up @@ -57,7 +57,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
"tslint": "5.20.1",
Expand Down
5 changes: 1 addition & 4 deletions packages/plugins/suggestions/test/suggestions.spec.js
@@ -1,8 +1,5 @@
import assert from 'assert';

describe('plugins/suggestions', () => {

it('should run test', () => {
assert.ok(true);
expect(true).toBe(true);
});
});
2 changes: 1 addition & 1 deletion packages/stack/blockchain/package.json
Expand Up @@ -68,7 +68,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/communication/package.json
Expand Up @@ -61,7 +61,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/stack/communication/test/communication.spec.js
Expand Up @@ -3,6 +3,8 @@ import assert from 'assert';
import { fakeEmbark } from 'embark-testing';
import Communication from '../src/';

/* eslint jest/expect-expect: ["error", { "assertFunctionNames": ["assert", "expect"] }] */

describe('stack/communication', () => {

// eslint-disable-next-line no-unused-vars
Expand Down
2 changes: 1 addition & 1 deletion packages/stack/compiler/package.json
Expand Up @@ -66,7 +66,7 @@
"embark-solo": "^5.2.3",
"embark-testing": "^5.3.0-nightly.4",
"eslint": "6.8.0",
"eslint-plugin-jest": "22.5.1",
"eslint-plugin-jest": "23.8.1",
"jest": "25.1.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
Expand Down

0 comments on commit a362365

Please sign in to comment.