Skip to content

Commit b3970c9

Browse files
authored
Merge pull request #83 from simonihmig/drop-node-8
2 parents 81ca22f + f66dcf9 commit b3970c9

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
strategy:
3434
matrix:
35-
node: ['^8.12.0', '10', '12']
35+
node: ['10', '12', '13']
3636
os: [ubuntu-latest, macOS-latest]
3737

3838
steps:

bin/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const pkgUp = require('pkg-up');
1515
function insideProject() {
1616
let nearestPackagePath = pkgUp.sync();
1717

18-
if (nearestPackagePath === null) {
18+
if (!nearestPackagePath) {
1919
return false;
2020
}
2121

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"walk-sync": "^2.0.2"
6666
},
6767
"engines": {
68-
"node": "8.* || 10.* || >= 12"
68+
"node": "10.* || >= 12"
6969
},
7070
"publishConfig": {
7171
"registry": "https://registry.npmjs.org"

tests/cli-test.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const ROOT = process.cwd();
1212
QUnit.module('codemod-cli', function(hooks) {
1313
let codemodProject;
1414

15-
function setupProject(hooks) {
15+
function setupProject(hooks, installDeps = false) {
1616
let sharedProject;
1717

1818
hooks.before(async function() {
@@ -24,13 +24,22 @@ QUnit.module('codemod-cli', function(hooks) {
2424
process.chdir(ROOT);
2525
});
2626

27-
hooks.beforeEach(function() {
27+
hooks.beforeEach(async function() {
2828
codemodProject.copy(sharedProject.path('test-project'));
2929

30+
const jestPath = `${codemodProject.path()}/node_modules/jest`;
31+
const codemodCliPath = `${codemodProject.path()}/node_modules/codemod-cli`;
32+
33+
if (installDeps) {
34+
await execa('yarn');
35+
fs.removeSync(jestPath);
36+
fs.removeSync(codemodCliPath);
37+
}
38+
3039
// setup required dependencies in the project
3140
fs.ensureDirSync(`${codemodProject.path()}/node_modules`);
32-
fs.symlinkSync(`${ROOT}/node_modules/jest`, `${codemodProject.path()}/node_modules/jest`);
33-
fs.symlinkSync(PROJECT_ROOT, `${codemodProject.path()}/node_modules/codemod-cli`);
41+
fs.symlinkSync(`${ROOT}/node_modules/jest`, jestPath);
42+
fs.symlinkSync(PROJECT_ROOT, codemodCliPath);
3443
});
3544
}
3645

@@ -72,11 +81,7 @@ QUnit.module('codemod-cli', function(hooks) {
7281
});
7382

7483
QUnit.module('linting', function(hooks) {
75-
setupProject(hooks);
76-
77-
hooks.beforeEach(async function() {
78-
await execa('yarn');
79-
});
84+
setupProject(hooks, true);
8085

8186
QUnit.test('should pass for a basic project', async function(assert) {
8287
let result = await execa('yarn', ['lint']);

0 commit comments

Comments
 (0)