Skip to content

Commit

Permalink
fix(semantic-release): _actually_ update semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Apr 7, 2018
1 parent 09f6662 commit 5623699
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
12 changes: 12 additions & 0 deletions src/scripts/__tests__/__snapshots__/precommit.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

exports[`precommit calls lint-staged CLI with default args 1`] = `lint-staged --config ./src/config/lintstagedrc.js`;

exports[`precommit calls lint-staged CLI with default args 2`] = `npm run validate`;

exports[`precommit does not use built-in config with .lintstagedrc file 1`] = `lint-staged`;

exports[`precommit does not use built-in config with .lintstagedrc file 2`] = `npm run validate`;

exports[`precommit does not use built-in config with --config 1`] = `lint-staged --config ./custom-config.js`;

exports[`precommit does not use built-in config with --config 2`] = `npm run validate`;

exports[`precommit does not use built-in config with lint-staged pkg prop 1`] = `lint-staged`;

exports[`precommit does not use built-in config with lint-staged pkg prop 2`] = `npm run validate`;

exports[`precommit does not use built-in config with lint-staged.config.js file 1`] = `lint-staged`;

exports[`precommit does not use built-in config with lint-staged.config.js file 2`] = `npm run validate`;

exports[`precommit forwards args 1`] = `lint-staged --config ./src/config/lintstagedrc.js --verbose`;

exports[`precommit forwards args 2`] = `npm run validate`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`travis-after-success calls concurrently with both scripts when on travis 1`] = `npx travis-deploy-once`;

exports[`travis-after-success calls concurrently with both scripts when on travis 2`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release'"`;
exports[`travis-after-success calls concurrently with both scripts when on travis 2`] = `concurrently --prefix [{name}] --names codecov,release --prefix-colors bgBlue.bold.reset,bgGreen.bold.reset "echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'" "echo installing semantic-release && npx -p semantic-release@15 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not do autorelease script when running on travis but in a pull request 1`] = `npx travis-deploy-once`;

Expand All @@ -14,11 +14,11 @@ exports[`travis-after-success does not do the autorelease script when the versio

exports[`travis-after-success does not do the codecov script when opted out 1`] = `npx travis-deploy-once`;

exports[`travis-after-success does not do the codecov script when opted out 2`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release'"`;
exports[`travis-after-success does not do the codecov script when opted out 2`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@15 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not do the codecov script when there is no coverage directory 1`] = `npx travis-deploy-once`;

exports[`travis-after-success does not do the codecov script when there is no coverage directory 2`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release'"`;
exports[`travis-after-success does not do the codecov script when there is no coverage directory 2`] = `concurrently --prefix [{name}] --names release --prefix-colors bgBlue.bold.reset "echo installing semantic-release && npx -p semantic-release@15 -c 'echo running semantic-release && semantic-release'"`;

exports[`travis-after-success does not run either script when no coverage dir and not the right version 1`] = `
Array [
Expand Down
10 changes: 6 additions & 4 deletions src/scripts/__tests__/precommit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ cases(
try {
// tests
require('../precommit')
expect(crossSpawnSyncMock).toHaveBeenCalledTimes(1)
const [firstCall] = crossSpawnSyncMock.mock.calls
const [script, calledArgs] = firstCall
expect([script, ...calledArgs].join(' ')).toMatchSnapshot()
expect(crossSpawnSyncMock).toHaveBeenCalledTimes(2)
const [firstCall, secondCall] = crossSpawnSyncMock.mock.calls
const [scriptOne, calledArgsOne] = firstCall
expect([scriptOne, ...calledArgsOne].join(' ')).toMatchSnapshot()
const [scriptTwo, calledArgsTwo] = secondCall
expect([scriptTwo, ...calledArgsTwo].join(' ')).toMatchSnapshot()
} catch (error) {
throw error
} finally {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/travis-after-success.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function runAfterSuccessScripts() {
? `echo installing codecov && npx -p codecov -c 'echo running codecov && codecov'`
: null,
release: autorelease
? `echo installing semantic-release && npx -p semantic-release@8 -c 'echo running semantic-release && semantic-release'`
? `echo installing semantic-release && npx -p semantic-release@15 -c 'echo running semantic-release && semantic-release'`
: null,
},
{killOthers: false},
Expand Down

0 comments on commit 5623699

Please sign in to comment.