Skip to content

Commit

Permalink
Tweak integration tests (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed May 4, 2020
1 parent 7439465 commit 05f5ccb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions 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).
17 changes: 10 additions & 7 deletions 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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 05f5ccb

Please sign in to comment.