Skip to content

Commit

Permalink
fix: upgrade deps (#42)
Browse files Browse the repository at this point in the history
I think this may fix issues with jest and `babel-plugin-istanbul`
  • Loading branch information
Kent C. Dodds authored Oct 27, 2017
1 parent df57424 commit ec3df93
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 36 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ node_js: '8'
install: npm install
script: npm run validate
after_success:
- npx codecov
- npx -p semantic-release@7 -c "semantic-release pre && npm publish && semantic-release post"
- kcd-scripts travis-after-success
branches:
only: master
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"license": "MIT",
"dependencies": {
"babel-core": "^6.26.0",
"babel-macros": "^1.0.0",
"babel-macros": "^1.1.1",
"babel-register": "^6.26.0",
"babylon": "^6.18.0",
"require-from-string": "^1.2.1"
"require-from-string": "^2.0.1"
},
"devDependencies": {
"ast-pretty-print": "^2.0.0",
"ast-pretty-print": "^2.0.1",
"babel-plugin-tester": "^4.0.0",
"kcd-scripts": "^0.4.0"
"kcd-scripts": "^0.27.0"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js"
Expand Down
3 changes: 3 additions & 0 deletions src/__tests__/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": [["env", {"targets": {"node": "8"}}]]
}
4 changes: 2 additions & 2 deletions src/__tests__/__snapshots__/index.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const y = preval\`
↓ ↓ ↓ ↓ ↓ ↓
const y = { "booyah": function booyah() {
const y = { "booyah": function () {
return "booyah";
} };
Expand Down Expand Up @@ -138,7 +138,7 @@ import x from /* preval({object: "argument", withFunction: () => {}}) */ "./fixt
↓ ↓ ↓ ↓ ↓ ↓
const x = { "object": "argument", "withFunction": function withFunction() {} };
const x = { "object": "argument", "withFunction": () => {} };
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const x = myPreval(\`
↓ ↓ ↓ ↓ ↓ ↓
const x = { "sayHi": function sayHi() {
return 'hi';
} };
const x = { "sayHi": () => 'hi' };
`;

Expand Down Expand Up @@ -53,6 +51,6 @@ x = 3 + preval
↓ ↓ ↓ ↓ ↓ ↓
Error: <PROJECT_ROOT>/src/__tests__/macros.js: ../macro: babel-plugin-preval/macro can only be used as tagged template expression, function call or JSX element. You tried BinaryExpression.
Error: <PROJECT_ROOT>/src/__tests__/macro.js: ../macro: babel-plugin-preval/macro can only be used as tagged template expression, function call or JSX element. You tried BinaryExpression.
`;
26 changes: 3 additions & 23 deletions src/__tests__/macros.js → src/__tests__/macro.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ expect.addSnapshotSerializer({
pluginTester({
plugin,
snapshot: true,
tests: withFilename([
babelOptions: {filename: __filename, parserOpts: {plugins: ['jsx']}},
tests: [
{
title: 'as tag',
code: `
Expand Down Expand Up @@ -57,26 +58,5 @@ pluginTester({
x = 3 + preval
`,
},
]),
],
})

/*
* This adds the filename to each test so you can do require/import relative
* to this test file.
*/
function withFilename(tests) {
return tests.map(t => {
const test = {babelOptions: {filename: __filename}}
if (typeof t === 'string') {
test.code = t
} else {
Object.assign(test, t)
test.babelOptions.parserOpts = test.babelOptions.parserOpts || {}
}
Object.assign(test.babelOptions.parserOpts, {
// add the jsx plugin to all tests because why not?
plugins: ['jsx'],
})
return test
})
}
1 change: 0 additions & 1 deletion src/macro.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* istanbul ignore next */
// const printAST = require('ast-pretty-print')
const {createMacro} = require('babel-macros')
const getReplacement = require('./get-replacement')
Expand Down

0 comments on commit ec3df93

Please sign in to comment.