diff --git a/package.json b/package.json index e5bf0610bd..d56028970a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "ava": "^3.8.1", "babel-eslint": "^10.1.0", "chalk": "^4.0.0", - "del": "^5.1.0", "eslint": "^6.8.0", "eslint-ava-rule-tester": "^4.0.0", "eslint-plugin-eslint-plugin": "^2.2.1", diff --git a/test/integration/readme.md b/test/integration/readme.md new file mode 100644 index 0000000000..6d4124f7ef --- /dev/null +++ b/test/integration/readme.md @@ -0,0 +1,5 @@ +# Integration tests + +To run the integration tests, go to the project root, and run `$ npm run integration`. + +To run tests on specific projects, run `$ npm run integration projectName1 projectName2 … projectNameN`. The project names can be found in [`project.js`](project.js). diff --git a/test/integration/test.js b/test/integration/test.js index 57ca936586..f1f5927775 100755 --- a/test/integration/test.js +++ b/test/integration/test.js @@ -1,12 +1,17 @@ #!/usr/bin/env node 'use strict'; +const fs = require('fs'); const path = require('path'); const Listr = require('listr'); const execa = require('execa'); -const del = require('del'); const chalk = require('chalk'); const {isCI} = require('ci-info'); -const projects = require('./projects'); +const allProjects = require('./projects'); + +const projectsArguments = process.argv.slice(2); +const projects = projectsArguments.length === 0 ? + allProjects : + allProjects.filter(({name}) => projectsArguments.includes(name)); const enrichErrors = (packageName, cliArguments, f) => async (...arguments_) => { try { @@ -81,6 +86,7 @@ const execute = project => { return new Listr([ { title: 'Cloning', + skip: () => fs.existsSync(destination) ? 'Project already downloaded.' : false, task: () => execa('git', [ 'clone', project.repository, @@ -93,13 +99,10 @@ const execute = project => { { title: 'Running eslint', task: makeEslintTask(project, destination) - }, - { - title: 'Clean up', - task: () => del(destination, {force: true}) } - ].map(({title, task}) => ({ + ].map(({title, task, skip}) => ({ title: `${project.name} / ${title}`, + skip, task })), { exitOnError: false