Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop node 8 #83

Merged
merged 3 commits into from
Jun 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12.x
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install
- name: linting
Expand All @@ -34,16 +32,14 @@ jobs:

strategy:
matrix:
node: ['^8.12.0', '10', '12']
node: ['10', '12', '13']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add 14?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure: #87

os: [ubuntu-latest, macOS-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: install yarn
run: npm install --global yarn
- name: install dependencies
run: yarn
- name: test
Expand All @@ -58,8 +54,6 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: install yarn
run: npm install -g yarn
- name: install dependencies
run: yarn install --no-lockfile
- name: test
Expand Down
2 changes: 1 addition & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const pkgUp = require('pkg-up');
function insideProject() {
let nearestPackagePath = pkgUp.sync();

if (nearestPackagePath === null) {
if (!nearestPackagePath) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"walk-sync": "^2.0.2"
},
"engines": {
"node": "8.* || 10.* || >= 12"
"node": "10.* || >= 12"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
23 changes: 14 additions & 9 deletions tests/cli-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ROOT = process.cwd();
QUnit.module('codemod-cli', function(hooks) {
let codemodProject;

function setupProject(hooks) {
function setupProject(hooks, installDeps = false) {
let sharedProject;

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

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

const jestPath = `${codemodProject.path()}/node_modules/jest`;
const codemodCliPath = `${codemodProject.path()}/node_modules/codemod-cli`;

if (installDeps) {
await execa('yarn');
fs.removeSync(jestPath);
fs.removeSync(codemodCliPath);
}

// setup required dependencies in the project
fs.ensureDirSync(`${codemodProject.path()}/node_modules`);
fs.symlinkSync(`${ROOT}/node_modules/jest`, `${codemodProject.path()}/node_modules/jest`);
fs.symlinkSync(PROJECT_ROOT, `${codemodProject.path()}/node_modules/codemod-cli`);
fs.symlinkSync(`${ROOT}/node_modules/jest`, jestPath);
fs.symlinkSync(PROJECT_ROOT, codemodCliPath);
});
}

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

QUnit.module('linting', function(hooks) {
setupProject(hooks);

hooks.beforeEach(async function() {
await execa('yarn');
});
setupProject(hooks, true);

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