Skip to content

Commit

Permalink
- updated all dependencies to latest versions
Browse files Browse the repository at this point in the history
- fixed linter/prettier errors
- fixed vulnerabilities (`npm audit fix`)
  • Loading branch information
ldgit committed May 3, 2020
1 parent 1bb50a4 commit 4fa0709
Show file tree
Hide file tree
Showing 14 changed files with 403 additions and 577 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ node_js:
- "12"
- "13"
script:
- npm run test-all
- npm run test:all
after_success: npm run coverage
2 changes: 1 addition & 1 deletion argus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
testDir: 'test/integration',
sourceDir: 'src',
testRunnerCommand: { command: 'npm', arguments: ['t', '--'] },
runAllTestsCommand: { command: 'npm', arguments: ['run', 'test-int'] },
runAllTestsCommand: { command: 'npm', arguments: ['run', 'test:int'] },
},
],
};
907 changes: 372 additions & 535 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@
"argus": "./index.js"
},
"devDependencies": {
"@sinonjs/fake-timers": "^6.0.1",
"chai": "^4.2.0",
"coveralls": "^3.0.9",
"coveralls": "^3.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.10.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-chai-expect": "^2.1.0",
"eslint-plugin-import": "^2.20.0",
"lolex": "^5.1.2",
"mocha": "^7.0.1",
"nyc": "^15.0.0",
"prettier": "^1.19.1",
"eslint-plugin-import": "^2.20.2",
"mocha": "^7.1.2",
"nyc": "^15.0.1",
"prettier": "^2.0.5",
"touch": "^3.1.0"
},
"dependencies": {
"chalk": "^3.0.0",
"chokidar": "^3.3.1",
"commander": "^4.1.0",
"cross-spawn": "^7.0.1",
"date-fns": "^2.9.0",
"chalk": "^4.0.0",
"chokidar": "^3.4.0",
"commander": "^5.1.0",
"cross-spawn": "^7.0.2",
"date-fns": "^2.12.0",
"glob": "^7.1.6",
"lodash": "^4.17.15"
},
Expand All @@ -60,8 +60,8 @@
},
"scripts": {
"test": "mocha",
"test-int": "mocha test/integration/**/*.test.js",
"test-all": "npm run prettier && npm run lint && npm test && npm run test-int",
"test:int": "mocha test/integration/**/*.test.js",
"test:all": "npm run prettier && npm run lint && npm test && npm run test:int",
"lint": "eslint test/ src/ ./index.js",
"coverage": "nyc --all npm t && nyc report --reporter=text-lcov | coveralls",
"prettier": "prettier --check \"./**/*.{js,md}\""
Expand Down
2 changes: 1 addition & 1 deletion src/argus.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { buildForFilepaths } = require('./command-builder');
const { compileWatchlistFor } = require('./watchlist');
const readConfiguration = require('./configuration-reader');
const getCommandLineOptions = require('./command-line-options');
const { listenForUserInput, setLastRunCommands } = require('./../src/user-input-handler');
const { listenForUserInput, setLastRunCommands } = require('./user-input-handler');

module.exports = {
runArgus: configureRunArgus(runCommands, getCommandLineOptions(process.argv), process.stdin),
Expand Down
2 changes: 1 addition & 1 deletion src/command-line-options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const program = require('commander');
const { version } = require('./../package.json');
const { version } = require('../package.json');

module.exports = function getCommandLineOptions(processArgv) {
program
Expand Down
2 changes: 1 addition & 1 deletion src/command-runner.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const formatDate = require('date-fns/format');
const crossSpawn = require('cross-spawn');
const { consolePrinter, format } = require('../src/printer');
const { consolePrinter, format } = require('./printer');

function configureRunCommands(spawn, printer, stdin, platform) {
return runCommands.bind(null, spawn, printer, stdin, platform);
Expand Down
7 changes: 1 addition & 6 deletions src/file-watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,7 @@ function getFilesWatchedCount(environments, watched) {

Object.values(watched).forEach(files => {
filesWatchedCount += files.filter(file =>
supportedExtensions.includes(
file
.split('.')
.pop()
.toLowerCase(),
),
supportedExtensions.includes(file.split('.').pop().toLowerCase()),
).length;
});

Expand Down
10 changes: 2 additions & 8 deletions src/test-finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ function getPossibleTestPath(filePath, environment) {

function getEnvironmentsForFile(filePath, environments) {
const foundEnvironments = [];
const fileExtension = filePath
.split('.')
.pop()
.toLowerCase();
const fileExtension = filePath.split('.').pop().toLowerCase();
environments.forEach(environment => {
if (environment.extension === fileExtension) {
foundEnvironments.push(environment);
Expand All @@ -44,10 +41,7 @@ function getEnvironmentsForFile(filePath, environments) {
}

function pathWithoutExtensionAndSourceDir(filePath, environment) {
return removeSourceDirFromPath(filePath, environment)
.split('.')
.slice(0, -1)
.join('.');
return removeSourceDirFromPath(filePath, environment).split('.').slice(0, -1).join('.');
}

function removeSourceDirFromPath(filePath, environment) {
Expand Down
4 changes: 2 additions & 2 deletions src/user-input-handler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { format, consolePrinter } = require('../src/printer');
const { buildCommandsToRunAllTests } = require('../src/command-builder');
const { format, consolePrinter } = require('./printer');
const { buildCommandsToRunAllTests } = require('./command-builder');

module.exports = {
listenForUserInput: unconfiguredListenForUserInput.bind(null, process.exit, consolePrinter),
Expand Down
2 changes: 1 addition & 1 deletion test/command-line-options.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { expect } = require('chai');
const path = require('path');
const getCommandLineOptions = require('../src/command-line-options');
const { version } = require('./../package.json');
const { version } = require('../package.json');

describe('command line options', () => {
let processArgv;
Expand Down
4 changes: 2 additions & 2 deletions test/command-runner.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { expect } = require('chai');
const lolex = require('lolex');
const FakeTimers = require('@sinonjs/fake-timers');
const { spawnSync } = require('child_process');
const { configureRunCommands } = require('../src/command-runner');
const { createPrinterSpy, format } = require('../src/printer');
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('command-runner', () => {
let clock;

beforeEach(() => {
clock = lolex.install({ now: new Date(2017, 7, 1, 18, 5, 5) });
clock = FakeTimers.install({ now: new Date(2017, 7, 1, 18, 5, 5) });
});

afterEach(() => clock.uninstall());
Expand Down
2 changes: 1 addition & 1 deletion test/integration/argus.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { fork } = require('child_process');
const { configureRunArgus } = require('../../src/argus');
const { runCommands } = require('../../src/command-runner');
const createRunCommandsSpy = require('../helpers/run-commands-spy');
const { StdinMock } = require('./../helpers/mockStdio');
const { StdinMock } = require('../helpers/mockStdio');

const wait = miliseconds => new Promise(resolve => setTimeout(resolve, miliseconds));
const waitForDebounce = () => wait(110);
Expand Down
4 changes: 2 additions & 2 deletions test/user-input-handler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ const {
listenForUserInput,
unconfiguredListenForUserInput,
setLastRunCommands,
} = require('./../src/user-input-handler');
} = require('../src/user-input-handler');
const createRunCommandsSpy = require('./helpers/run-commands-spy');
const { format, createPrinterSpy } = require('../src/printer');
const { runCommands } = require('./../src/command-runner');
const { runCommands } = require('../src/command-runner');
const wait = require('./helpers/wait');

describe('configureListenForInput', () => {
Expand Down

0 comments on commit 4fa0709

Please sign in to comment.