Skip to content

Commit

Permalink
chore: upgrade packages, add test on @babel/parser
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Aug 28, 2019
1 parent a6af17e commit 49ff738
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 8 deletions.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": "standard-changelog && git add CHANGELOG.md",
"postversion": "git push && git push --tags && npm publish",
"pretest": "npm run lint",
"browser-test": "browserify spec/acorn.spec.js spec/cherow.spec.js spec/espree.spec.js spec/esprima.spec.js spec/index-exports.spec.js | browser-do --tap | tap-dot",
"browser-test": "browserify spec/acorn.spec.js spec/cherow.spec.js spec/espree.spec.js spec/esprima.spec.js spec/babel-parser.spec.js spec/index-exports.spec.js | browser-do --tap | tap-dot",
"nodejs-test": "tape \"spec/*.spec.js\" | tap-dot",
"test": "npm run nodejs-test && npm run browser-test"
},
Expand All @@ -38,15 +38,16 @@
},
"homepage": "https://github.com/dumberjs/ast-matcher#readme",
"devDependencies": {
"acorn": "^6.1.1",
"browserify": "^16.2.3",
"@babel/parser": "^7.5.5",
"acorn": "^7.0.0",
"browser-do": "^0.3.2",
"browserify": "^16.5.0",
"cherow": "^1.6.9",
"eslint": "^6.0.1",
"espree": "^6.0.0",
"eslint": "^6.2.2",
"espree": "^6.1.1",
"esprima": "^4.0.1",
"standard-changelog": "^2.0.11",
"standard-changelog": "^2.0.13",
"tap-dot": "^2.0.0",
"tape": "^4.11.0",
"browser-do": "^0.3.2"
"tape": "^4.11.0"
}
}
35 changes: 35 additions & 0 deletions spec/babel-parser.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
'use strict';
const parser = require('@babel/parser');
const withParser = require('./with-parser');

withParser('@babel/parser', code => {
const file = parser.parse(code, {sourceType: 'module', plugins: [
'jsx',
'typescript',
'asyncGenerators',
'bigInt',
'classProperties',
'classPrivateProperties',
'classPrivateMethods',
'decorators-legacy',
// ['decorators', {'decoratorsBeforeExport': true}],
'doExpressions',
'dynamicImport',
'exportDefaultFrom',
'exportNamespaceFrom',
'functionBind',
'functionSent',
'importMeta',
'logicalAssignment',
'nullishCoalescingOperator',
'numericSeparator',
'objectRestSpread',
'optionalCatchBinding',
'optionalChaining',
'partialApplication',
// ['pipelineOperator', {proposal: 'minimal'}],
'throwExpressions',
'estree'
]});
return file && file.program;
});

0 comments on commit 49ff738

Please sign in to comment.