diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 0ef5ffc2..00000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["@babel/env"] -} diff --git a/.circleci/config.yml b/.circleci/config.yml index 49023dd1..c58fe779 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,16 +12,16 @@ jobs: # Download and cache dependencies - restore_cache: keys: - - v1-dependencies-{{ checksum "package.json" }} + - node-8-dependencies-{{ checksum "package.json" }} # fallback to using the latest cache if no exact match is found - - v1-dependencies- + - node-8-dependencies- - run: yarn install - save_cache: paths: - node_modules - key: v1-dependencies-{{ checksum "package.json" }} + key: node-8-dependencies-{{ checksum "package.json" }} # run tests! - run: npm run test diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 4ebc8aea..00000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -coverage diff --git a/.eslintrc b/.eslintrc index b1951627..93caab6f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,11 +1,15 @@ { "root": true, "extends": [ + "plugin:vue/recommended", "standard", "prettier", "prettier/standard" ], "rules": { "no-new": 0 + }, + "env": { + "jest": true } } diff --git a/.gitignore b/.gitignore index 59ed9d8c..03280d22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ #OS files .DS_Store node_modules +**/node_modules/** # Editor files /.idea diff --git a/test/__snapshots__/sourceMaps.spec.js.snap b/e2e/__projects__/babel-config/__snapshots__/test.js.snap similarity index 55% rename from test/__snapshots__/sourceMaps.spec.js.snap rename to e2e/__projects__/babel-config/__snapshots__/test.js.snap index e2fb0d90..40b03485 100644 --- a/test/__snapshots__/sourceMaps.spec.js.snap +++ b/e2e/__projects__/babel-config/__snapshots__/test.js.snap @@ -2,7 +2,7 @@ exports[`generates source maps for .vue files 1`] = ` "var exports = {} - \\"use strict\\"; +\\"use strict\\"; Object.defineProperty(exports, \\"__esModule\\", { value: true @@ -14,6 +14,22 @@ exports.default = void 0; // // // +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// var _default = { name: 'basic', computed: { @@ -39,12 +55,12 @@ var _default = { }; exports.default = _default; - if(!exports.default) { - exports.default = {} - } - var __options__ = module.exports = exports.default - Object.keys(exports).forEach(k => module.exports[k] = exports[k]) - var render = function() { +if(!exports.default) { + exports.default = {} +} +var __options__ = module.exports = exports.default +Object.keys(exports).forEach(k => module.exports[k] = exports[k]) +var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h @@ -55,15 +71,30 @@ exports.default = _default; var staticRenderFns = [] render._withStripped = true - __options__.render = render - __options__.staticRenderFns = staticRenderFns - -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJhc2ljLnZ1ZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFLQTtBQVBBO0FBU0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQWpCQSIsInNvdXJjZXNDb250ZW50IjpbIjx0ZW1wbGF0ZT5cbiAgICA8ZGl2IGNsYXNzPVwiaGVsbG9cIj5cbiAgICAgICAgPGgxIDpjbGFzcz1cImhlYWRpbmdDbGFzc2VzXCI+e3sgbXNnIH19PC9oMT5cbiAgICA8L2Rpdj5cbjwvdGVtcGxhdGU+XG5cbjxzY3JpcHQ+XG4gICAgZXhwb3J0IGRlZmF1bHQge1xuICAgICAgICBuYW1lOiAnYmFzaWMnLFxuICAgICAgICBjb21wdXRlZDoge1xuICAgICAgICAgICAgaGVhZGluZ0NsYXNzZXM6IGZ1bmN0aW9uIGhlYWRpbmdDbGFzc2VzKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHJlZDogdGhpcy5pc0NyYXp5LFxuICAgICAgICAgICAgICAgICAgICBibHVlOiAhdGhpcy5pc0NyYXp5LFxuICAgICAgICAgICAgICAgICAgICBzaGFkb3c6IHRoaXMuaXNDcmF6eSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgZGF0YTogZnVuY3Rpb24gZGF0YSgpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgbXNnOiAnV2VsY29tZSB0byBZb3VyIFZ1ZS5qcyBBcHAnLFxuICAgICAgICAgICAgICAgIGlzQ3Jhenk6IGZhbHNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgbWV0aG9kczoge1xuICAgICAgICAgICAgdG9nZ2xlQ2xhc3M6IGZ1bmN0aW9uIHRvZ2dsZUNsYXNzKCkge1xuICAgICAgICAgICAgICAgIHRoaXMuaXNDcmF6eSA9ICF0aGlzLmlzQ3Jhenk7XG4gICAgICAgICAgICB9LFxuICAgICAgICB9LFxuICAgIH07XG48L3NjcmlwdD5cbiJdfQ==" +__options__.render = render +__options__.staticRenderFns = staticRenderFns +;(function() { + var beforeCreate = __options__.beforeCreate + var styleFn = function () { if(!this['css']) { + this['css'] = {}; +} +this['css'] = Object.assign( +this['css'], {\\"testA\\":\\"testA\\"}); +if(!this['$style']) { + this['$style'] = {}; +} +this['$style'] = Object.assign( +this['$style'], {\\"testB\\":\\"testB\\"}); + } + __options__.beforeCreate = beforeCreate ? [].concat(beforeCreate, styleFn) : [styleFn] +})() + +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJhc2ljLnZ1ZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUtBO0FBUEE7QUFTQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBakJBIiwic291cmNlc0NvbnRlbnQiOlsiPHRlbXBsYXRlPlxuICA8ZGl2IGNsYXNzPVwiaGVsbG9cIj5cbiAgICA8aDEgOmNsYXNzPVwiaGVhZGluZ0NsYXNzZXNcIj57eyBtc2cgfX08L2gxPlxuICA8L2Rpdj5cbjwvdGVtcGxhdGU+XG5cbjxzdHlsZSBtb2R1bGU9XCJjc3NcIj5cbi50ZXN0QSB7XG4gIGJhY2tncm91bmQtY29sb3I6IHJlZDtcbn1cbjwvc3R5bGU+XG48c3R5bGUgbW9kdWxlPlxuLnRlc3RCIHtcbiAgYmFja2dyb3VuZC1jb2xvcjogYmx1ZTtcbn1cbjwvc3R5bGU+XG48c3R5bGU+XG4udGVzdEMge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiBibHVlO1xufVxuPC9zdHlsZT5cblxuPHNjcmlwdD5cbmV4cG9ydCBkZWZhdWx0IHtcbiAgbmFtZTogJ2Jhc2ljJyxcbiAgY29tcHV0ZWQ6IHtcbiAgICBoZWFkaW5nQ2xhc3NlczogZnVuY3Rpb24gaGVhZGluZ0NsYXNzZXMoKSB7XG4gICAgICByZXR1cm4ge1xuICAgICAgICByZWQ6IHRoaXMuaXNDcmF6eSxcbiAgICAgICAgYmx1ZTogIXRoaXMuaXNDcmF6eSxcbiAgICAgICAgc2hhZG93OiB0aGlzLmlzQ3JhenlcbiAgICAgIH1cbiAgICB9XG4gIH0sXG4gIGRhdGE6IGZ1bmN0aW9uIGRhdGEoKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG1zZzogJ1dlbGNvbWUgdG8gWW91ciBWdWUuanMgQXBwJyxcbiAgICAgIGlzQ3Jhenk6IGZhbHNlXG4gICAgfVxuICB9LFxuICBtZXRob2RzOiB7XG4gICAgdG9nZ2xlQ2xhc3M6IGZ1bmN0aW9uIHRvZ2dsZUNsYXNzKCkge1xuICAgICAgdGhpcy5pc0NyYXp5ID0gIXRoaXMuaXNDcmF6eVxuICAgIH1cbiAgfVxufVxuPC9zY3JpcHQ+XG4iXX0=" `; exports[`generates source maps using src attributes 1`] = ` "var exports = {} - \\"use strict\\"; +\\"use strict\\"; Object.defineProperty(exports, \\"__esModule\\", { value: true @@ -94,12 +125,12 @@ var _default = { }; exports.default = _default; - if(!exports.default) { - exports.default = {} - } - var __options__ = module.exports = exports.default - Object.keys(exports).forEach(k => module.exports[k] = exports[k]) - var render = function() { +if(!exports.default) { + exports.default = {} +} +var __options__ = module.exports = exports.default +Object.keys(exports).forEach(k => module.exports[k] = exports[k]) +var render = function() { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h @@ -110,8 +141,8 @@ exports.default = _default; var staticRenderFns = [] render._withStripped = true - __options__.render = render - __options__.staticRenderFns = staticRenderFns - +__options__.render = render +__options__.staticRenderFns = staticRenderFns + //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJhc2ljU3JjLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUtBO0FBUEE7QUFTQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBakJBIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge1xuICBuYW1lOiAnYmFzaWMnLFxuICBjb21wdXRlZDoge1xuICAgIGhlYWRpbmdDbGFzc2VzOiBmdW5jdGlvbiBoZWFkaW5nQ2xhc3NlcygpIHtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIHJlZDogdGhpcy5pc0NyYXp5LFxuICAgICAgICBibHVlOiAhdGhpcy5pc0NyYXp5LFxuICAgICAgICBzaGFkb3c6IHRoaXMuaXNDcmF6eVxuICAgICAgfVxuICAgIH1cbiAgfSxcbiAgZGF0YTogZnVuY3Rpb24gZGF0YSgpIHtcbiAgICByZXR1cm4ge1xuICAgICAgbXNnOiAnV2VsY29tZSB0byBZb3VyIFZ1ZS5qcyBBcHAnLFxuICAgICAgaXNDcmF6eTogZmFsc2VcbiAgICB9XG4gIH0sXG4gIG1ldGhvZHM6IHtcbiAgICB0b2dnbGVDbGFzczogZnVuY3Rpb24gdG9nZ2xlQ2xhc3MoKSB7XG4gICAgICB0aGlzLmlzQ3JhenkgPSAhdGhpcy5pc0NyYXp5XG4gICAgfVxuICB9XG59XG4iXX0=" `; diff --git a/e2e/__projects__/babel-config/babel.config.js b/e2e/__projects__/babel-config/babel.config.js new file mode 100644 index 00000000..7db9b6f5 --- /dev/null +++ b/e2e/__projects__/babel-config/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: ['@babel/preset-env'] +} diff --git a/e2e/__projects__/babel-config/components/Basic.vue b/e2e/__projects__/babel-config/components/Basic.vue new file mode 100644 index 00000000..a37429b0 --- /dev/null +++ b/e2e/__projects__/babel-config/components/Basic.vue @@ -0,0 +1,47 @@ + + + + + + + diff --git a/test/resources/BasicSrc.html b/e2e/__projects__/babel-config/components/BasicSrc.html similarity index 100% rename from test/resources/BasicSrc.html rename to e2e/__projects__/babel-config/components/BasicSrc.html diff --git a/test/resources/BasicSrc.js b/e2e/__projects__/babel-config/components/BasicSrc.js similarity index 100% rename from test/resources/BasicSrc.js rename to e2e/__projects__/babel-config/components/BasicSrc.js diff --git a/test/resources/BasicSrc.vue b/e2e/__projects__/babel-config/components/BasicSrc.vue similarity index 100% rename from test/resources/BasicSrc.vue rename to e2e/__projects__/babel-config/components/BasicSrc.vue diff --git a/test/resources/CoffeeES6.vue b/e2e/__projects__/babel-config/components/Coffee.vue similarity index 100% rename from test/resources/CoffeeES6.vue rename to e2e/__projects__/babel-config/components/Coffee.vue diff --git a/test/resources/CoffeeScript.vue b/e2e/__projects__/babel-config/components/CoffeeScript.vue similarity index 100% rename from test/resources/CoffeeScript.vue rename to e2e/__projects__/babel-config/components/CoffeeScript.vue diff --git a/e2e/__projects__/babel-config/components/FunctionalSFC.vue b/e2e/__projects__/babel-config/components/FunctionalSFC.vue new file mode 100644 index 00000000..1395f320 --- /dev/null +++ b/e2e/__projects__/babel-config/components/FunctionalSFC.vue @@ -0,0 +1,5 @@ + diff --git a/e2e/__projects__/babel-config/components/FunctionalSFCParent.vue b/e2e/__projects__/babel-config/components/FunctionalSFCParent.vue new file mode 100644 index 00000000..01509456 --- /dev/null +++ b/e2e/__projects__/babel-config/components/FunctionalSFCParent.vue @@ -0,0 +1,14 @@ + + + diff --git a/test/resources/Jade.vue b/e2e/__projects__/babel-config/components/Jade.vue similarity index 56% rename from test/resources/Jade.vue rename to e2e/__projects__/babel-config/components/Jade.vue index 0a5d7fd3..4195a137 100644 --- a/test/resources/Jade.vue +++ b/e2e/__projects__/babel-config/components/Jade.vue @@ -3,7 +3,7 @@ diff --git a/e2e/__projects__/babel-config/components/Less.vue b/e2e/__projects__/babel-config/components/Less.vue new file mode 100644 index 00000000..0ae5c4ee --- /dev/null +++ b/e2e/__projects__/babel-config/components/Less.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/e2e/__projects__/babel-config/components/NamedExport.vue b/e2e/__projects__/babel-config/components/NamedExport.vue new file mode 100644 index 00000000..1d2c6f0f --- /dev/null +++ b/e2e/__projects__/babel-config/components/NamedExport.vue @@ -0,0 +1,7 @@ + diff --git a/test/resources/NoScript.vue b/e2e/__projects__/babel-config/components/NoScript.vue similarity index 100% rename from test/resources/NoScript.vue rename to e2e/__projects__/babel-config/components/NoScript.vue diff --git a/e2e/__projects__/babel-config/components/PostCss.vue b/e2e/__projects__/babel-config/components/PostCss.vue new file mode 100644 index 00000000..e147826b --- /dev/null +++ b/e2e/__projects__/babel-config/components/PostCss.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/test/resources/PugExtends.vue b/e2e/__projects__/babel-config/components/Pug.vue similarity index 50% rename from test/resources/PugExtends.vue rename to e2e/__projects__/babel-config/components/Pug.vue index 012118d9..eddf14e4 100644 --- a/test/resources/PugExtends.vue +++ b/e2e/__projects__/babel-config/components/Pug.vue @@ -1,11 +1,11 @@ \ No newline at end of file +export default { + name: 'pug' +} + diff --git a/test/resources/PugBase.pug b/e2e/__projects__/babel-config/components/PugBase.pug similarity index 100% rename from test/resources/PugBase.pug rename to e2e/__projects__/babel-config/components/PugBase.pug diff --git a/e2e/__projects__/babel-config/components/PugRelativeExtends.vue b/e2e/__projects__/babel-config/components/PugRelativeExtends.vue new file mode 100644 index 00000000..963ec0fa --- /dev/null +++ b/e2e/__projects__/babel-config/components/PugRelativeExtends.vue @@ -0,0 +1,11 @@ + + + diff --git a/e2e/__projects__/babel-config/components/RenderFunction.vue b/e2e/__projects__/babel-config/components/RenderFunction.vue new file mode 100644 index 00000000..fcabb646 --- /dev/null +++ b/e2e/__projects__/babel-config/components/RenderFunction.vue @@ -0,0 +1,8 @@ + diff --git a/e2e/__projects__/babel-config/components/Sass.vue b/e2e/__projects__/babel-config/components/Sass.vue new file mode 100644 index 00000000..877d76f6 --- /dev/null +++ b/e2e/__projects__/babel-config/components/Sass.vue @@ -0,0 +1,15 @@ + + + + + diff --git a/e2e/__projects__/babel-config/components/Scss.vue b/e2e/__projects__/babel-config/components/Scss.vue new file mode 100644 index 00000000..5e2eab57 --- /dev/null +++ b/e2e/__projects__/babel-config/components/Scss.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/test/resources/SourceMapsSrc.vue b/e2e/__projects__/babel-config/components/SourceMapsSrc.vue similarity index 100% rename from test/resources/SourceMapsSrc.vue rename to e2e/__projects__/babel-config/components/SourceMapsSrc.vue diff --git a/e2e/__projects__/babel-config/components/Stylus.vue b/e2e/__projects__/babel-config/components/Stylus.vue new file mode 100644 index 00000000..f1c951e8 --- /dev/null +++ b/e2e/__projects__/babel-config/components/Stylus.vue @@ -0,0 +1,22 @@ + + + + + + + diff --git a/test/resources/TypeScript.vue b/e2e/__projects__/babel-config/components/TypeScript.vue similarity index 100% rename from test/resources/TypeScript.vue rename to e2e/__projects__/babel-config/components/TypeScript.vue diff --git a/test/resources/TypeScriptChild.vue b/e2e/__projects__/babel-config/components/TypeScriptChild.vue similarity index 100% rename from test/resources/TypeScriptChild.vue rename to e2e/__projects__/babel-config/components/TypeScriptChild.vue diff --git a/test/coffee.spec.js b/e2e/__projects__/babel-config/components/coffee.spec.js similarity index 100% rename from test/coffee.spec.js rename to e2e/__projects__/babel-config/components/coffee.spec.js diff --git a/test/relative/PugRelativeBase.pug b/e2e/__projects__/babel-config/components/relative/PugRelativeBase.pug similarity index 100% rename from test/relative/PugRelativeBase.pug rename to e2e/__projects__/babel-config/components/relative/PugRelativeBase.pug diff --git a/test/relative/resource.styl b/e2e/__projects__/babel-config/components/relative/resource.styl similarity index 100% rename from test/relative/resource.styl rename to e2e/__projects__/babel-config/components/relative/resource.styl diff --git a/e2e/__projects__/babel-config/components/styles/sass-a.sass b/e2e/__projects__/babel-config/components/styles/sass-a.sass new file mode 100644 index 00000000..222ddb76 --- /dev/null +++ b/e2e/__projects__/babel-config/components/styles/sass-a.sass @@ -0,0 +1,4 @@ +@import "./sass-b" + +.a + background-color: blue diff --git a/e2e/__projects__/babel-config/components/styles/sass-b.sass b/e2e/__projects__/babel-config/components/styles/sass-b.sass new file mode 100644 index 00000000..ec96d2c0 --- /dev/null +++ b/e2e/__projects__/babel-config/components/styles/sass-b.sass @@ -0,0 +1,2 @@ +.b + background-color: blue diff --git a/e2e/__projects__/babel-config/components/styles/scss-a.scss b/e2e/__projects__/babel-config/components/styles/scss-a.scss new file mode 100644 index 00000000..30630635 --- /dev/null +++ b/e2e/__projects__/babel-config/components/styles/scss-a.scss @@ -0,0 +1,5 @@ +@import "./scss-b"; + +.a { + background-color: blue +} diff --git a/test/resources/styles/scss/direct-imports-second.scss b/e2e/__projects__/babel-config/components/styles/scss-b.scss similarity index 52% rename from test/resources/styles/scss/direct-imports-second.scss rename to e2e/__projects__/babel-config/components/styles/scss-b.scss index 783030fb..b8341292 100644 --- a/test/resources/styles/scss/direct-imports-second.scss +++ b/e2e/__projects__/babel-config/components/styles/scss-b.scss @@ -1,3 +1,3 @@ -.directImportSecondClass { +.b { background-color: blue; } diff --git a/e2e/__projects__/babel-config/package.json b/e2e/__projects__/babel-config/package.json new file mode 100644 index 00000000..607a7a91 --- /dev/null +++ b/e2e/__projects__/babel-config/package.json @@ -0,0 +1,44 @@ +{ + "name": "babel-config", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "scripts": { + "test": "jest --no-cache --coverage test.js" + }, + "dependencies": { + "vue": "^2.5.21", + "vue-template-compiler": "^2.5.21" + }, + "devDependencies": { + "@babel/core": "^7.2.2", + "@babel/preset-env": "^7.2.3", + "@vue/test-utils": "^1.0.0-beta.28", + "babel-core": "^7.0.0-bridge.0", + "jest": "^23.6.0", + "node-sass": "^4.11.0", + "vue-jest": "file:../../../" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "vue" + ], + "transform": { + "^.+\\.js$": "babel-jest", + "^.+\\.vue$": "vue-jest" + }, + "moduleNameMapper": { + "^~?__styles/(.*)$": "/components/styles/$1" + }, + "globals": { + "vue-jest": { + "pug": { + "basedir": "./" + } + } + } + } +} diff --git a/e2e/__projects__/babel-config/test.js b/e2e/__projects__/babel-config/test.js new file mode 100644 index 00000000..a7b7ba8e --- /dev/null +++ b/e2e/__projects__/babel-config/test.js @@ -0,0 +1,148 @@ +import { mount } from '@vue/test-utils' +import TypeScript from './components/TypeScript.vue' +import Stylus from './components/Stylus.vue' +import { resolve } from 'path' +import { readFileSync } from 'fs' +import jestVue from 'vue-jest' +import Scss from './components/Scss.vue' +import Sass from './components/Sass.vue' +import RenderFunction from './components/RenderFunction.vue' +import Jade from './components/Jade.vue' +import FunctionalSFC from './components/FunctionalSFC.vue' +import Basic from './components/Basic.vue' +import BasicSrc from './components/BasicSrc.vue' +import { randomExport } from './components/NamedExport.vue' +import Coffee from './components/Coffee.vue' +import CoffeeScript from './components/CoffeeScript.vue' +import FunctionalSFCParent from './components/FunctionalSFCParent.vue' +import NoScript from './components/NoScript.vue' +import Less from './components/Less.vue' +import PostCss from './components/PostCss.vue' +import Pug from './components/Pug.vue' +import PugRelative from './components/PugRelativeExtends.vue' + +test('processes .vue files', () => { + const wrapper = mount(Basic) + wrapper.vm.toggleClass() +}) + +test('processes .vue files with src attributes', () => { + const wrapper = mount(BasicSrc) + wrapper.vm.toggleClass() +}) + +test('handles named exports', () => { + expect(randomExport).toEqual(42) +}) + +test('generates source maps for .vue files', () => { + const filePath = resolve(__dirname, './components/Basic.vue') + const fileString = readFileSync(filePath, { encoding: 'utf8' }) + + const { code } = jestVue.process(fileString, filePath, { + moduleFileExtensions: ['js', 'vue'] + }) + + expect(code).toMatchSnapshot() +}) + +test('generates source maps using src attributes', () => { + const filePath = resolve(__dirname, './components/SourceMapsSrc.vue') + const fileString = readFileSync(filePath, { encoding: 'utf8' }) + + const { code } = jestVue.process(fileString, filePath, { + moduleFileExtensions: ['js', 'vue'] + }) + + expect(code).toMatchSnapshot() +}) + +test('processes .vue file with lang set to coffee', () => { + const wrapper = mount(Coffee) + expect(wrapper.vm).toBeTruthy() +}) + +test('processes .vue file with lang set to coffeescript', () => { + const wrapper = mount(CoffeeScript) + expect(wrapper.vm).toBeTruthy() +}) + +test('processes .vue files with lang set to typescript', () => { + const wrapper = mount(TypeScript) + expect(wrapper.vm).toBeTruthy() +}) + +test('processes functional components', () => { + const clickSpy = jest.fn() + const wrapper = mount(FunctionalSFC, { + context: { + props: { msg: { id: 1, title: 'foo' }, onClick: clickSpy } + } + }) + expect(wrapper.text().trim()).toBe('foo') + wrapper.trigger('click') + expect(clickSpy).toHaveBeenCalledWith(1) +}) + +test('processes SFC with functional template from parent', () => { + const wrapper = mount(FunctionalSFCParent) + expect(wrapper.text().trim()).toBe('foo') +}) + +test('handles missing script block', () => { + const wrapper = mount(NoScript) + expect(wrapper.contains('footer')) +}) + +test('processes .vue file with jade template', () => { + const wrapper = mount(Jade) + expect(wrapper.is('div')).toBe(true) + expect(wrapper.classes()).toContain('jade') +}) + +it('processes Less', () => { + const wrapper = mount(Less) + expect(wrapper.vm).toBeTruthy() +}) + +it('processes PostCSS', () => { + const wrapper = mount(PostCss) + expect(wrapper.vm).toBeTruthy() +}) + +test('processes pug templates', () => { + const wrapper = mount(Pug) + expect(wrapper.is('div')).toBe(true) + expect(wrapper.classes()).toContain('pug-base') + expect(wrapper.find('.pug-extended').exists()).toBeTruthy() +}) + +test('supports relative paths when extending templates from .pug files', () => { + const wrapper = mount(PugRelative) + expect(wrapper.is('div')).toBe(true) + expect(wrapper.find('.pug-relative-base').exists()).toBeTruthy() +}) + +test('processes SFC with no template', () => { + const wrapper = mount(RenderFunction) + expect(wrapper.is('section')).toBe(true) +}) + +it('processes Sass', () => { + const wrapper = mount(Sass) + expect(wrapper.vm.$style.a).toEqual('a') + expect(wrapper.vm.$style.b).toEqual('b') + expect(wrapper.vm.$style.c).toEqual('c') +}) + +it('processes SCSS', () => { + const wrapper = mount(Scss) + expect(wrapper.vm.$style.a).toEqual('a') + expect(wrapper.vm.$style.b).toEqual('b') + expect(wrapper.vm.$style.c).toEqual('c') +}) + +test('process Stylus', () => { + const wrapper = mount(Stylus) + expect(wrapper.vm).toBeTruthy() +}) diff --git a/tsconfig.json b/e2e/__projects__/babel-config/tsconfig.json similarity index 88% rename from tsconfig.json rename to e2e/__projects__/babel-config/tsconfig.json index 17e77c44..8073706e 100644 --- a/tsconfig.json +++ b/e2e/__projects__/babel-config/tsconfig.json @@ -4,7 +4,7 @@ "lib": ["dom", "es6"], "module": "es2015", "moduleResolution": "node", - "types": ["vue-typescript-import-dts", "jest", "node"], + "types": ["vue-typescript-import-dts", "node"], "isolatedModules": false, "experimentalDecorators": true, "noImplicitAny": true, diff --git a/e2e/__projects__/babel-in-package/components/Basic.vue b/e2e/__projects__/babel-in-package/components/Basic.vue new file mode 100644 index 00000000..a37429b0 --- /dev/null +++ b/e2e/__projects__/babel-in-package/components/Basic.vue @@ -0,0 +1,47 @@ + + + + + + + diff --git a/test/resources/Coffee.vue b/e2e/__projects__/babel-in-package/components/Coffee.vue similarity index 83% rename from test/resources/Coffee.vue rename to e2e/__projects__/babel-in-package/components/Coffee.vue index 6b0c046c..1d3b1bed 100644 --- a/test/resources/Coffee.vue +++ b/e2e/__projects__/babel-in-package/components/Coffee.vue @@ -3,6 +3,6 @@ diff --git a/e2e/__projects__/babel-in-package/components/TypeScript.vue b/e2e/__projects__/babel-in-package/components/TypeScript.vue new file mode 100644 index 00000000..145560ab --- /dev/null +++ b/e2e/__projects__/babel-in-package/components/TypeScript.vue @@ -0,0 +1,21 @@ + + + diff --git a/e2e/__projects__/babel-in-package/components/TypeScriptChild.vue b/e2e/__projects__/babel-in-package/components/TypeScriptChild.vue new file mode 100644 index 00000000..985a1f72 --- /dev/null +++ b/e2e/__projects__/babel-in-package/components/TypeScriptChild.vue @@ -0,0 +1,13 @@ + + + diff --git a/e2e/__projects__/babel-in-package/package.json b/e2e/__projects__/babel-in-package/package.json new file mode 100644 index 00000000..7617a65e --- /dev/null +++ b/e2e/__projects__/babel-in-package/package.json @@ -0,0 +1,41 @@ +{ + "name": "babel-in-package", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "scripts": { + "test": "jest --no-cache test.js" + }, + "dependencies": { + "vue": "^2.5.21", + "vue-template-compiler": "^2.5.21" + }, + "devDependencies": { + "@babel/core": "^7.2.2", + "@babel/preset-env": "^7.2.3", + "@vue/test-utils": "^1.0.0-beta.28", + "babel-core": "^7.0.0-bridge.0", + "jest": "^23.6.0", + "vue-jest": "file:../../../" + }, + "jest": { + "moduleFileExtensions": [ + "js", + "json", + "vue" + ], + "transform": { + "^.+\\.js$": "babel-jest", + "^.+\\.vue$": "vue-jest" + }, + "moduleNameMapper": { + "^~?__styles/(.*)$": "/components/styles/$1" + } + }, + "babel": { + "presets": [ + "@babel/env" + ] + } +} diff --git a/e2e/__projects__/babel-in-package/test.js b/e2e/__projects__/babel-in-package/test.js new file mode 100644 index 00000000..70be30d8 --- /dev/null +++ b/e2e/__projects__/babel-in-package/test.js @@ -0,0 +1,19 @@ +import { mount } from '@vue/test-utils' +import TypeScript from './components/TypeScript.vue' +import Basic from './components/Basic.vue' +import Coffee from './components/Coffee.vue' + +test('processes .vue files', () => { + const wrapper = mount(Basic) + wrapper.vm.toggleClass() +}) + +test('processes .vue file with lang set to coffee', () => { + const wrapper = mount(Coffee) + expect(wrapper.vm).toBeTruthy() +}) + +test('processes .vue files with lang set to typescript', () => { + const wrapper = mount(TypeScript) + expect(wrapper.vm).toBeTruthy() +}) diff --git a/e2e/__projects__/babel-in-package/tsconfig.json b/e2e/__projects__/babel-in-package/tsconfig.json new file mode 100644 index 00000000..d3fd602d --- /dev/null +++ b/e2e/__projects__/babel-in-package/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2017", + "lib": ["dom", "es6"], + "module": "ES2015", + "moduleResolution": "node", + "types": ["vue-typescript-import-dts", "node"], + "isolatedModules": false, + "experimentalDecorators": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "removeComments": true, + "emitDecoratorMetadata": true, + "suppressImplicitAnyIndexErrors": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true + } +} diff --git a/e2e/test-runner.js b/e2e/test-runner.js new file mode 100644 index 00000000..384dd6b0 --- /dev/null +++ b/e2e/test-runner.js @@ -0,0 +1,59 @@ +const { spawnSync } = require('child_process') +const path = require('path') +const fs = require('fs-extra') +const chalk = require('chalk') + +const IGNORE_FILES = ['.DS_Store'] + +function success(msg) { + console.info(chalk.green('\n[vue-jest]: ' + msg + '\n')) +} + +function info(msg) { + console.info(chalk.blue('\n[vue-jest]: ' + msg + '\n')) +} + +function runTest(dir) { + const resolvedPath = path.resolve(__dirname, '__projects__', dir) + + const run = command => { + const [cmd, ...args] = command.split(' ') + const { status } = spawnSync(cmd, args, { + cwd: resolvedPath, + env: { PATH: process.env.PATH }, + stdio: 'inherit', + shell: true + }) + if (status !== 0) { + process.exit(status) + } + } + + const log = msg => info(`(${dir}) ${msg}`) + + log('Running tests') + + log('Removing node_modules') + fs.removeSync(`${resolvedPath}/node_modules`) + + log('Removing package-lock.json') + fs.removeSync(`${resolvedPath}/package-lock.json`) + + log('Installing node_modules') + run('npm install --silent') + + log('Running tests') + run('npm run test') + + success(`(${dir}) Complete`) +} + +async function testRunner(dir) { + const directories = fs + .readdirSync(path.resolve(__dirname, '__projects__')) + .filter(d => !IGNORE_FILES.includes(d)) + + directories.forEach(runTest) +} + +testRunner() diff --git a/vue-jest.js b/lib/index.js similarity index 91% rename from vue-jest.js rename to lib/index.js index c512955a..d18d2e4e 100644 --- a/vue-jest.js +++ b/lib/index.js @@ -1,10 +1,9 @@ -const process = require('./lib/process') const crypto = require('crypto') const babelJest = require('babel-jest') const tsJest = require('ts-jest') module.exports = { - process: process, + process: require('./process'), getCacheKey: function getCacheKey( fileData, filename, diff --git a/lib/process.js b/lib/process.js index 862cb0be..7f51d442 100644 --- a/lib/process.js +++ b/lib/process.js @@ -65,13 +65,14 @@ module.exports = function(src, filePath, config) { inputMap ) - let output = `var exports = {} - ${compiledScriptContent} - if(!exports.default) { - exports.default = {} - } - var __options__ = module.exports = exports.default - Object.keys(exports).forEach(k => module.exports[k] = exports[k])` + let output = + `var exports = {}\n` + + `${compiledScriptContent}\n` + + `if(!exports.default) {\n` + + ` exports.default = {}\n` + + `}\n` + + `var __options__ = module.exports = exports.default\n` + + `Object.keys(exports).forEach(k => module.exports[k] = exports[k])\n` if (parts.template) { parts.template.filename = filePath @@ -96,11 +97,10 @@ module.exports = function(src, filePath, config) { throwError('Vue template compilation failed') } - output += ` - ${templateResult.code} - __options__.render = render - __options__.staticRenderFns = staticRenderFns - ` + output += + `${templateResult.code}\n` + + `__options__.render = render\n` + + `__options__.staticRenderFns = staticRenderFns\n` if (parts.template.attrs.functional) { output += '__options__.functional = true\n' @@ -132,38 +132,35 @@ module.exports = function(src, filePath, config) { const moduleName = ast.module === true ? '$style' : ast.module - return ` - if(!this['${moduleName}']) { - this['${moduleName}'] = {}; - } - this['${moduleName}'] = Object.assign(this['${moduleName}'], ${JSON.stringify( - styleObj - )}); - ` + return ( + `if(!this['${moduleName}']) {\n` + + ` this['${moduleName}'] = {};\n` + + `}\n` + + `this['${moduleName}'] = Object.assign(\n` + + `this['${moduleName}'], ${JSON.stringify(styleObj)});\n` + ) }) .filter(_ => _) .join('') if (styleStr.length !== 0) { if (parts.template && parts.template.attrs.functional) { - output += ` - ;(function() { - var originalRender = __options__.render - var styleFn = function () { ${styleStr} } - __options__.render = function renderWithStyleInjection (h, context) { - styleFn.call(context) - return originalRender(h, context) - } - })() - ` + output += + `;(function() {\n` + + ` var originalRender = __options__.render\n` + + ` var styleFn = function () { ${styleStr} }\n` + + ` __options__.render = function renderWithStyleInjection (h, context) {\n` + + ` styleFn.call(context)\n` + + ` return originalRender(h, context)\n` + + ` }\n` + + `})()\n` } else { - output += ` - ;(function() { - var beforeCreate = __options__.beforeCreate - var styleFn = function () { ${styleStr} } - __options__.beforeCreate = beforeCreate ? [].concat(beforeCreate, styleFn) : [styleFn] - })() - ` + output += + `;(function() {\n` + + ` var beforeCreate = __options__.beforeCreate\n` + + ` var styleFn = function () { ${styleStr} }\n` + + ` __options__.beforeCreate = beforeCreate ? [].concat(beforeCreate, styleFn) : [styleFn]\n` + + `})()\n` } } } diff --git a/lib/throw-error.js b/lib/throw-error.js deleted file mode 100644 index dcd3a0cf..00000000 --- a/lib/throw-error.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function error(msg) { - throw new Error('\n[vue-jest] Error: ' + msg + '\n') -} diff --git a/lib/utils.js b/lib/utils.js index 02fd0d79..3287b6c8 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,5 +1,6 @@ const loadPartialConfig = require('@babel/core').loadPartialConfig const createTransformer = require('ts-jest').createTransformer +const chalk = require('chalk') module.exports.getVueJestConfig = function getVueJestConfig(jestConfig) { return ( @@ -28,11 +29,11 @@ module.exports.getTsJestConfig = function getTsJestConfig(config) { } module.exports.info = function info(msg) { - console.info('\n[vue-jest]: ' + msg + '\n') + console.info(chalk.blue('\n[vue-jest]: ' + msg + '\n')) } module.exports.warn = function warn(msg) { - console.warn('\n[vue-jest]: ' + msg + '\n') + console.warn(chalk.red('\n[vue-jest]: ' + msg + '\n')) } module.exports.throwError = function error(msg) { diff --git a/package.json b/package.json index be64c705..e5acfa45 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,8 @@ "name": "vue-jest", "version": "3.0.0", "description": "Jest Vue transform", - "main": "vue-jest.js", + "main": "lib/index.js", "files": [ - "vue-jest.js", "lib" ], "keywords": [ @@ -20,13 +19,12 @@ ], "scripts": { "format": "prettier --no-semi --single-quote --write '{,!(node_modules)/**/}*.{js,json,md}'", - "lint": "eslint '{,!(node_modules|temp-dir)/**/}*.js'", + "lint": "eslint --ignore-path .gitignore '{,!(node_modules)/**/}*.js'", "lint:fix": "npm run lint -- --fix", - "release": "build/release.sh", - "release:note": "node build/gen-release-note.js", - "test": "npm run lint && npm run test:unit", - "test:unit": "./test.sh", - "test:unit:run": "jest test --no-cache --runInBand --coverage --coverageDirectory test/coverage" + "release": "scripts/release.sh", + "release:note": "node scripts/gen-release-note.js", + "test": "npm run lint && npm run test:e2e", + "test:e2e": "node e2e/test-runner" }, "author": "Edd Yerburgh", "license": "MIT", @@ -36,17 +34,17 @@ "@vue/test-utils": "^1.0.0-beta.25", "babel-core": "^7.0.0-bridge.0", "babel-jest": "^23.6.0", - "babel-plugin-istanbul": "^5.1.0", - "clear-module": "^2.1.0", "coffeescript": "^2.3.2", "conventional-changelog": "^1.1.5", - "eslint": "^5.9.0", + "eslint": "^5.12.0", "eslint-config-prettier": "^3.3.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-node": "^8.0.0", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-standard": "^4.0.0", + "eslint-plugin-vue": "^5.1.0", + "fs-extra": "^7.0.1", "hamljs": "^0.6.2", "husky": "^1.1.4", "jade": "^1.11.0", @@ -61,42 +59,20 @@ "vue-template-compiler": "^2.4.2" }, "peerDependencies": { - "babel-core": "^6.25.0 || ^7.x", "@babel/core": "7.x", + "babel-core": "^6.25.0 || ^7.x", "jest": "^23.x", "vue": "^2.x", "vue-template-compiler": "^2.x" }, "dependencies": { "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@vue/component-compiler-utils": "^2.3.0", + "@vue/component-compiler-utils": "^2.4.0", "chalk": "^2.1.0", "extract-from-css": "^0.4.4", "source-map": "^0.5.6", "ts-jest": "^23.10.5" }, - "jest": { - "moduleFileExtensions": [ - "js", - "json", - "vue" - ], - "transform": { - "^.+\\.js$": "babel-jest", - ".*\\.(vue)$": "./vue-jest.js" - }, - "moduleNameMapper": { - "^~?__root/(.*)$": "/$1", - "^~?__test/(.*)$": "/test/$1" - }, - "globals": { - "vue-jest": { - "pug": { - "basedir": "test" - } - } - } - }, "repository": { "type": "git", "url": "git+https://github.com/vuejs/vue-jest.git" diff --git a/build/gen-release-note.js b/scripts/gen-release-note.js similarity index 100% rename from build/gen-release-note.js rename to scripts/gen-release-note.js diff --git a/build/release.sh b/scripts/release.sh similarity index 100% rename from build/release.sh rename to scripts/release.sh diff --git a/test.sh b/test.sh deleted file mode 100755 index 64aa9bce..00000000 --- a/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -rm -rf temp-dir -mkdir temp-dir -cp -R test temp-dir/test -cp -R lib temp-dir/lib -cp -R node_modules temp-dir/node_modules -cp vue-jest.js temp-dir/vue-jest.js -cp package.json temp-dir/package.json -cp .babelrc temp-dir/.babelrc -cp tsconfig.json temp-dir/tsconfig.json -cd temp-dir -yarn test:unit:run diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index 595ffff6..00000000 --- a/test/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": '../.eslintrc', - "env": { - "jest": true - } -} \ No newline at end of file diff --git a/test/Babel.spec.js b/test/Babel.spec.js deleted file mode 100644 index b9a22403..00000000 --- a/test/Babel.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -import Vue from 'vue' -import Basic from './resources/Basic.vue' -import BasicSrc from './resources/BasicSrc.vue' -import clearModule from 'clear-module' - -beforeEach(() => { - clearModule.all() -}) - -test('processes .vue files', () => { - const vm = new Vue(Basic).$mount() - vm.toggleClass() - const vm2 = new Vue(BasicSrc).$mount() - vm2.toggleClass() - expect(typeof vm.$el).toBe('object') -}) - -test('processes .vue files using src attributes', () => { - const vm = new Vue(BasicSrc).$mount() - expect(typeof vm.$el).toBe('object') - vm.toggleClass() -}) diff --git a/test/FunctionalSFC.spec.js b/test/FunctionalSFC.spec.js deleted file mode 100644 index dbab1f82..00000000 --- a/test/FunctionalSFC.spec.js +++ /dev/null @@ -1,38 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import FunctionalSFC from './resources/FunctionalSFC.vue' - -let wrapper -const clickSpy = jest.fn() -beforeEach(() => { - wrapper = shallowMount(FunctionalSFC, { - context: { - props: { msg: { id: 1, title: 'foo' }, onClick: clickSpy } - } - }) -}) - -describe('Processes .vue file with functional template', () => { - it('with nested props', () => { - expect(wrapper.text().trim()).toBe('foo') - }) - - it('with callback prop', () => { - wrapper.trigger('click') - expect(clickSpy).toHaveBeenCalledWith(1) - }) - - it('is functional', () => { - expect(wrapper.isFunctionalComponent).toBe(true) - }) - - it('handles slot', () => { - wrapper = shallowMount(FunctionalSFC, { - context: { - props: { msg: { id: 1, title: '' } }, - children: ['this is a slot'] - } - }) - - expect(wrapper.text()).toBe('this is a slot') - }) -}) diff --git a/test/FunctionalSFCParent.spec.js b/test/FunctionalSFCParent.spec.js deleted file mode 100644 index 2525fb97..00000000 --- a/test/FunctionalSFCParent.spec.js +++ /dev/null @@ -1,7 +0,0 @@ -import { mount } from '@vue/test-utils' -import FunctionalSFCParent from './resources/FunctionalSFCParent.vue' - -test('processes .vue file with functional template from parent', () => { - const wrapper = mount(FunctionalSFCParent) - expect(wrapper.text().trim()).toBe('foo') -}) diff --git a/test/NamedExport.spec.js b/test/NamedExport.spec.js deleted file mode 100644 index a186f5a5..00000000 --- a/test/NamedExport.spec.js +++ /dev/null @@ -1,7 +0,0 @@ -import { randomExport } from './resources/NamedExport.vue' - -describe('NamedExport', () => { - it('exports named export "randomExport"', () => { - expect(randomExport).toEqual(42) - }) -}) diff --git a/test/NoScript.spec.js b/test/NoScript.spec.js deleted file mode 100644 index 15f2471c..00000000 --- a/test/NoScript.spec.js +++ /dev/null @@ -1,9 +0,0 @@ -import { mount } from '@vue/test-utils' -import NoScript from './resources/NoScript.vue' - -describe('NoScript', () => { - it('renders', () => { - const wrapper = mount(NoScript) - expect(wrapper.contains('footer')) - }) -}) diff --git a/test/RenderFunction.spec.js b/test/RenderFunction.spec.js deleted file mode 100644 index c09863d3..00000000 --- a/test/RenderFunction.spec.js +++ /dev/null @@ -1,8 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import RenderFunction from './resources/RenderFunction.vue' - -test('processes .vue file with no template', () => { - const wrapper = shallowMount(RenderFunction) - - expect(wrapper.is('section')).toBe(true) -}) diff --git a/test/TypeScript.spec.js b/test/TypeScript.spec.js deleted file mode 100644 index f74387ad..00000000 --- a/test/TypeScript.spec.js +++ /dev/null @@ -1,7 +0,0 @@ -import { mount } from '@vue/test-utils' -import TypeScript from './resources/TypeScript.vue' - -test('processes .vue files', () => { - const wrapper = mount(TypeScript) - expect(wrapper.vm).toBeTruthy() -}) diff --git a/test/css.spec.js b/test/css.spec.js deleted file mode 100644 index 4c5099ea..00000000 --- a/test/css.spec.js +++ /dev/null @@ -1,21 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import Css from './resources/Css.vue' - -describe('processes .vue file with Css style', () => { - let wrapper - beforeAll(() => { - wrapper = shallowMount(Css) - }) - - it('should bind from style tags with named module', () => { - expect(wrapper.classes()).toContain('testA') - }) - - it('should bind from style tags with anonymous modules', () => { - expect(wrapper.classes()).toContain('testB') - }) - - it('should not bind from style tags without a module', () => { - expect(wrapper.vm.$style.testC).toBeFalsy() - }) -}) diff --git a/test/jade.spec.js b/test/jade.spec.js deleted file mode 100644 index b66948ec..00000000 --- a/test/jade.spec.js +++ /dev/null @@ -1,8 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import Jade from './resources/Jade.vue' - -test('processes .vue file with jade template', () => { - const wrapper = shallowMount(Jade) - expect(wrapper.is('div')).toBe(true) - expect(wrapper.classes()).toContain('jade') -}) diff --git a/test/less.spec.js b/test/less.spec.js deleted file mode 100644 index 423b162e..00000000 --- a/test/less.spec.js +++ /dev/null @@ -1,14 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import Less from './resources/Less.vue' -import LessModule from './resources/LessModule.vue' - -describe('processes .vue file with Less style', () => { - it('does not error on less', () => { - const wrapper = shallowMount(Less) - expect(wrapper.classes()).toContain('testLess') - }) - - it('does not error on less module', () => { - expect(() => shallowMount(LessModule)).not.toThrow() - }) -}) diff --git a/test/postcss.spec.js b/test/postcss.spec.js deleted file mode 100644 index 0d98af38..00000000 --- a/test/postcss.spec.js +++ /dev/null @@ -1,14 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import PostCss from './resources/PostCss.vue' -import PostCssModule from './resources/PostCssModule.vue' - -describe('processes .vue file with PostCSS style', () => { - it('does not error on pcss/postcss', () => { - const wrapper = shallowMount(PostCss) - expect(wrapper.classes()).toContain('testPcss') - }) - - it('does not error on pcss/postcss module', () => { - expect(() => shallowMount(PostCssModule)).not.toThrow() - }) -}) diff --git a/test/pug.spec.js b/test/pug.spec.js deleted file mode 100644 index 062c3100..00000000 --- a/test/pug.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import Pug from './resources/Pug.vue' -import PugRelative from './resources/PugRelativeExtends.vue' -import PugExtends from './resources/PugExtends.vue' - -test('processes .vue file with pug template', () => { - const wrapper = shallowMount(Pug) - expect(wrapper.is('div')).toBe(true) - expect(wrapper.classes()).toContain('pug') -}) - -test('supports global pug options and extends templates correctly from .pug files', () => { - const wrapper = shallowMount(PugExtends) - expect(wrapper.is('div')).toBe(true) - expect(wrapper.find('.pug-extended').exists()).toBeTruthy() -}) - -test('supports relative paths when extending templates from .pug files', () => { - const wrapper = shallowMount(PugRelative) - expect(wrapper.is('div')).toBe(true) - expect(wrapper.find('.pug-relative-base').exists()).toBeTruthy() -}) diff --git a/test/resources/Basic.vue b/test/resources/Basic.vue deleted file mode 100644 index 43ba4f35..00000000 --- a/test/resources/Basic.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - diff --git a/test/resources/CoffeeScriptES6.vue b/test/resources/CoffeeScriptES6.vue deleted file mode 100644 index 979664d9..00000000 --- a/test/resources/CoffeeScriptES6.vue +++ /dev/null @@ -1,8 +0,0 @@ - - - diff --git a/test/resources/Css.vue b/test/resources/Css.vue deleted file mode 100644 index cbf3c766..00000000 --- a/test/resources/Css.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/test/resources/FunctionalSFC.vue b/test/resources/FunctionalSFC.vue deleted file mode 100644 index 6f3922ed..00000000 --- a/test/resources/FunctionalSFC.vue +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/test/resources/FunctionalSFCParent.vue b/test/resources/FunctionalSFCParent.vue deleted file mode 100644 index 1f908004..00000000 --- a/test/resources/FunctionalSFCParent.vue +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/test/resources/Less.vue b/test/resources/Less.vue deleted file mode 100644 index a4661a47..00000000 --- a/test/resources/Less.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/test/resources/LessModule.vue b/test/resources/LessModule.vue deleted file mode 100644 index 479f4e0e..00000000 --- a/test/resources/LessModule.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/test/resources/NamedExport.vue b/test/resources/NamedExport.vue deleted file mode 100644 index cd0fcc7e..00000000 --- a/test/resources/NamedExport.vue +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/test/resources/PostCss.vue b/test/resources/PostCss.vue deleted file mode 100644 index 57b1a148..00000000 --- a/test/resources/PostCss.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/test/resources/PostCssModule.vue b/test/resources/PostCssModule.vue deleted file mode 100644 index 46107de2..00000000 --- a/test/resources/PostCssModule.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/test/resources/Pug.vue b/test/resources/Pug.vue deleted file mode 100644 index b0fdcb3f..00000000 --- a/test/resources/Pug.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/test/resources/PugRelativeExtends.vue b/test/resources/PugRelativeExtends.vue deleted file mode 100644 index 477d283f..00000000 --- a/test/resources/PugRelativeExtends.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/test/resources/RenderFunction.vue b/test/resources/RenderFunction.vue deleted file mode 100644 index 6deff4b2..00000000 --- a/test/resources/RenderFunction.vue +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/test/resources/Sass.vue b/test/resources/Sass.vue deleted file mode 100644 index 58e0be1a..00000000 --- a/test/resources/Sass.vue +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/test/resources/SassModule.vue b/test/resources/SassModule.vue deleted file mode 100644 index 89d185f7..00000000 --- a/test/resources/SassModule.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - - - diff --git a/test/resources/SassModuleFunctional.vue b/test/resources/SassModuleFunctional.vue deleted file mode 100644 index d0882fbd..00000000 --- a/test/resources/SassModuleFunctional.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - \ No newline at end of file diff --git a/test/resources/Scss.vue b/test/resources/Scss.vue deleted file mode 100644 index 69c93c61..00000000 --- a/test/resources/Scss.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - diff --git a/test/resources/ScssModule.vue b/test/resources/ScssModule.vue deleted file mode 100644 index 11e51c1c..00000000 --- a/test/resources/ScssModule.vue +++ /dev/null @@ -1,26 +0,0 @@ - - - - - diff --git a/test/resources/ScssModuleFunctional.vue b/test/resources/ScssModuleFunctional.vue deleted file mode 100644 index 9d60589c..00000000 --- a/test/resources/ScssModuleFunctional.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/test/resources/StyleModule.vue b/test/resources/StyleModule.vue deleted file mode 100644 index a6efe28f..00000000 --- a/test/resources/StyleModule.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - diff --git a/test/resources/Stylus.vue b/test/resources/Stylus.vue deleted file mode 100644 index 2047e4e9..00000000 --- a/test/resources/Stylus.vue +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - diff --git a/test/resources/StylusRelative.vue b/test/resources/StylusRelative.vue deleted file mode 100644 index 3d74dc3e..00000000 --- a/test/resources/StylusRelative.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/test/resources/styles/sass/direct-imports-moduleNameMapper.sass b/test/resources/styles/sass/direct-imports-moduleNameMapper.sass deleted file mode 100644 index 6536c7d1..00000000 --- a/test/resources/styles/sass/direct-imports-moduleNameMapper.sass +++ /dev/null @@ -1,6 +0,0 @@ -@import "./sass-imports" -@import "./globals/global-classes-relative-direct" -@import "~__root/test/resources/styles/sass/globals/global-classes-moduleNameMapper-direct" - -.directImportModuleNameMapperClass - background-color: blue diff --git a/test/resources/styles/sass/direct-imports-multiple-moduleNameMapper.sass b/test/resources/styles/sass/direct-imports-multiple-moduleNameMapper.sass deleted file mode 100644 index 06312ebc..00000000 --- a/test/resources/styles/sass/direct-imports-multiple-moduleNameMapper.sass +++ /dev/null @@ -1,2 +0,0 @@ -.directImportMultipleModuleNameMapperClass - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/direct-imports-second.sass b/test/resources/styles/sass/direct-imports-second.sass deleted file mode 100644 index 6a8a4da3..00000000 --- a/test/resources/styles/sass/direct-imports-second.sass +++ /dev/null @@ -1,2 +0,0 @@ -.directImportSecondClass - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/direct-imports.sass b/test/resources/styles/sass/direct-imports.sass deleted file mode 100644 index c3b737f0..00000000 --- a/test/resources/styles/sass/direct-imports.sass +++ /dev/null @@ -1,7 +0,0 @@ -@import "./sass-imports" -@import "~__root/test/resources/styles/sass/sass-imports-moduleNameMapper" -@import "./globals/global-classes-relative-direct" -@import "~__root/test/resources/styles/sass/globals/global-classes-moduleNameMapper-direct" - -.directImportClass - background-color: blue diff --git a/test/resources/styles/sass/globals/global-classes-moduleNameMapper-direct.sass b/test/resources/styles/sass/globals/global-classes-moduleNameMapper-direct.sass deleted file mode 100644 index 310299f6..00000000 --- a/test/resources/styles/sass/globals/global-classes-moduleNameMapper-direct.sass +++ /dev/null @@ -1,2 +0,0 @@ -.globalClassesModuleNameMapperDirect - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/globals/global-classes-moduleNameMapper.sass b/test/resources/styles/sass/globals/global-classes-moduleNameMapper.sass deleted file mode 100644 index c639e932..00000000 --- a/test/resources/styles/sass/globals/global-classes-moduleNameMapper.sass +++ /dev/null @@ -1,2 +0,0 @@ -.globalClassesModuleNameMapper - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/globals/global-classes-relative-direct.sass b/test/resources/styles/sass/globals/global-classes-relative-direct.sass deleted file mode 100644 index fd819dc7..00000000 --- a/test/resources/styles/sass/globals/global-classes-relative-direct.sass +++ /dev/null @@ -1,2 +0,0 @@ -.globalClassesRelativeDirect - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/globals/global-classes-relative.sass b/test/resources/styles/sass/globals/global-classes-relative.sass deleted file mode 100644 index 63ff1ec8..00000000 --- a/test/resources/styles/sass/globals/global-classes-relative.sass +++ /dev/null @@ -1,2 +0,0 @@ -.globalClassesRelative - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/sass-imports-moduleNameMapper.sass b/test/resources/styles/sass/sass-imports-moduleNameMapper.sass deleted file mode 100644 index 177d382a..00000000 --- a/test/resources/styles/sass/sass-imports-moduleNameMapper.sass +++ /dev/null @@ -1,5 +0,0 @@ -@import "./globals/global-classes-relative" -@import "~__root/test/resources/styles/sass/globals/global-classes-moduleNameMapper" - -.sassImportModuleNameMapperClass - background-color: blue diff --git a/test/resources/styles/sass/sass-imports-multiple-moduleNameMapper.sass b/test/resources/styles/sass/sass-imports-multiple-moduleNameMapper.sass deleted file mode 100644 index 2ac065e2..00000000 --- a/test/resources/styles/sass/sass-imports-multiple-moduleNameMapper.sass +++ /dev/null @@ -1,2 +0,0 @@ -.sassImportMultipleModuleNameMapperClass - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/sass/sass-imports.sass b/test/resources/styles/sass/sass-imports.sass deleted file mode 100644 index 0a0aad21..00000000 --- a/test/resources/styles/sass/sass-imports.sass +++ /dev/null @@ -1,6 +0,0 @@ -@import "./globals/global-classes-relative" -@import "~__root/test/resources/styles/sass/globals/global-classes-moduleNameMapper" -@import "~__test/resources/styles/sass/sass-imports-multiple-moduleNameMapper" - -.sassImportClass - background-color: blue \ No newline at end of file diff --git a/test/resources/styles/scss/direct-imports-moduleNameMapper.scss b/test/resources/styles/scss/direct-imports-moduleNameMapper.scss deleted file mode 100644 index 9220932d..00000000 --- a/test/resources/styles/scss/direct-imports-moduleNameMapper.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import "./scss-imports"; -@import "./globals/global-classes-relative-direct"; -@import "~__root/test/resources/styles/scss/globals/global-classes-moduleNameMapper-direct"; - -.directImportModuleNameMapperClass { - background-color: blue; -} diff --git a/test/resources/styles/scss/direct-imports-multiple-moduleNameMapper.scss b/test/resources/styles/scss/direct-imports-multiple-moduleNameMapper.scss deleted file mode 100644 index 6935915c..00000000 --- a/test/resources/styles/scss/direct-imports-multiple-moduleNameMapper.scss +++ /dev/null @@ -1,3 +0,0 @@ -.directImportMultipleModuleNameMapperClass { - background-color: blue; -} diff --git a/test/resources/styles/scss/direct-imports.scss b/test/resources/styles/scss/direct-imports.scss deleted file mode 100644 index b14319e1..00000000 --- a/test/resources/styles/scss/direct-imports.scss +++ /dev/null @@ -1,8 +0,0 @@ -@import "./scss-imports"; -@import "~__root/test/resources/styles/scss/scss-imports-moduleNameMapper"; -@import "./globals/global-classes-relative-direct"; -@import "~__root/test/resources/styles/scss/globals/global-classes-moduleNameMapper-direct"; - -.directImportClass { - background-color: blue; -} diff --git a/test/resources/styles/scss/globals/global-classes-moduleNameMapper-direct.scss b/test/resources/styles/scss/globals/global-classes-moduleNameMapper-direct.scss deleted file mode 100644 index d3aa3a87..00000000 --- a/test/resources/styles/scss/globals/global-classes-moduleNameMapper-direct.scss +++ /dev/null @@ -1,3 +0,0 @@ -.globalClassesModuleNameMapperDirect { - background-color: blue; -} \ No newline at end of file diff --git a/test/resources/styles/scss/globals/global-classes-moduleNameMapper.scss b/test/resources/styles/scss/globals/global-classes-moduleNameMapper.scss deleted file mode 100644 index f5b4a997..00000000 --- a/test/resources/styles/scss/globals/global-classes-moduleNameMapper.scss +++ /dev/null @@ -1,3 +0,0 @@ -.globalClassesModuleNameMapper { - background-color: blue; -} \ No newline at end of file diff --git a/test/resources/styles/scss/globals/global-classes-relative-direct.scss b/test/resources/styles/scss/globals/global-classes-relative-direct.scss deleted file mode 100644 index bdf2d769..00000000 --- a/test/resources/styles/scss/globals/global-classes-relative-direct.scss +++ /dev/null @@ -1,3 +0,0 @@ -.globalClassesRelativeDirect { - background-color: blue; -} \ No newline at end of file diff --git a/test/resources/styles/scss/globals/global-classes-relative.scss b/test/resources/styles/scss/globals/global-classes-relative.scss deleted file mode 100644 index 019ba36f..00000000 --- a/test/resources/styles/scss/globals/global-classes-relative.scss +++ /dev/null @@ -1,3 +0,0 @@ -.globalClassesRelative { - background-color: blue; -} \ No newline at end of file diff --git a/test/resources/styles/scss/scss-imports-moduleNameMapper.scss b/test/resources/styles/scss/scss-imports-moduleNameMapper.scss deleted file mode 100644 index 7c868409..00000000 --- a/test/resources/styles/scss/scss-imports-moduleNameMapper.scss +++ /dev/null @@ -1,6 +0,0 @@ -@import "./globals/global-classes-relative"; -@import "~__root/test/resources/styles/scss/globals/global-classes-moduleNameMapper"; - -.scssImportModuleNameMapperClass { - background-color: blue; -} diff --git a/test/resources/styles/scss/scss-imports-multiple-moduleNameMapper.scss b/test/resources/styles/scss/scss-imports-multiple-moduleNameMapper.scss deleted file mode 100644 index e9d74b71..00000000 --- a/test/resources/styles/scss/scss-imports-multiple-moduleNameMapper.scss +++ /dev/null @@ -1,3 +0,0 @@ -.scssImportMultipleModuleNameMapperClass { - background-color: blue; -} diff --git a/test/resources/styles/scss/scss-imports.scss b/test/resources/styles/scss/scss-imports.scss deleted file mode 100644 index fd674668..00000000 --- a/test/resources/styles/scss/scss-imports.scss +++ /dev/null @@ -1,7 +0,0 @@ -@import "./globals/global-classes-relative"; -@import "~__root/test/resources/styles/scss/globals/global-classes-moduleNameMapper"; -@import "~__test/resources/styles/scss/scss-imports-multiple-moduleNameMapper"; - -.scssImportClass { - background-color: blue; -} diff --git a/test/sass.spec.js b/test/sass.spec.js deleted file mode 100644 index 04512e54..00000000 --- a/test/sass.spec.js +++ /dev/null @@ -1,130 +0,0 @@ -import { shallowMount, mount } from '@vue/test-utils' -import Sass from './resources/Sass.vue' -import SassModule from './resources/SassModule.vue' -import SassModuleFunctional from './resources/SassModuleFunctional.vue' - -describe('processes .vue file with sass style', () => { - it('does not error on sass', () => { - expect(() => shallowMount(Sass)).not.toThrow() - }) - it('does not error on sass module', () => { - expect(() => shallowMount(SassModule)).not.toThrow() - }) - it('does not error on sass module when functional', () => { - expect(() => mount(SassModuleFunctional)).not.toThrow() - }) -}) - -describe('processes .vue files which combine sass and modules', () => { - let wrapper - let functionalWrapper - - beforeEach(() => { - wrapper = shallowMount(SassModule) - functionalWrapper = mount(SassModuleFunctional) - }) - - it('does inject classes to $style', () => { - expect(wrapper.vm.$style).toBeDefined() - expect(wrapper.vm.$style.testA).toBeDefined() - expect(wrapper.vm.$style.testA).toEqual('testA') - expect(wrapper.vm.$style.testB).toBeDefined() - expect(wrapper.vm.$style.testB).toEqual('testB') - }) - - it('does inject classes to $style for functional components', () => { - expect(functionalWrapper.findAll('.testAFunctional')).toHaveLength(3) - expect(functionalWrapper.findAll('.testBFunctional')).toHaveLength(2) - expect(functionalWrapper.findAll('.otherTestAFunctional')).toHaveLength(1) - expect(functionalWrapper.findAll('.otherTestBFunctional')).toHaveLength(1) - }) - - describe('entrypoint: direct import in SFC', () => { - let wrapper - beforeEach(() => { - wrapper = shallowMount(SassModule) - }) - it('does inject classes from directly imported files by relative path', () => { - expect(wrapper.vm.$style.directImportClass).toBeDefined() - expect(wrapper.vm.$style.directImportClass).toEqual('directImportClass') - }) - it('does inject classes from directly imported files via moduleNameMapper', () => { - expect(wrapper.vm.$style.directImportModuleNameMapperClass).toBeDefined() - expect(wrapper.vm.$style.directImportModuleNameMapperClass).toEqual( - 'directImportModuleNameMapperClass' - ) - }) - it('does inject classes from directly imported files via moduleNameMapper for more than one rule', () => { - expect( - wrapper.vm.$style.directImportMultipleModuleNameMapperClass - ).toBeDefined() - expect( - wrapper.vm.$style.directImportMultipleModuleNameMapperClass - ).toEqual('directImportMultipleModuleNameMapperClass') - }) - it('does inject classes from files imported recursively by relative path', () => { - expect(wrapper.vm.$style.globalClassesRelativeDirect).toBeDefined() - expect(wrapper.vm.$style.globalClassesRelativeDirect).toEqual( - 'globalClassesRelativeDirect' - ) - }) - it('does inject classes from files imported recursively via moduleNameMapper', () => { - expect( - wrapper.vm.$style.globalClassesModuleNameMapperDirect - ).toBeDefined() - expect(wrapper.vm.$style.globalClassesModuleNameMapperDirect).toEqual( - 'globalClassesModuleNameMapperDirect' - ) - }) - }) - - describe('entrypoint: import inside previously imported stylesheet', () => { - let wrapper - beforeEach(() => { - wrapper = shallowMount(SassModule) - }) - it('does inject classes from imports within sass files by relative path', () => { - expect(wrapper.vm.$style.sassImportClass).toBeDefined() - expect(wrapper.vm.$style.sassImportClass).toEqual('sassImportClass') - }) - it('does inject classes from imports within sass files via moduleNameMapper', () => { - expect(wrapper.vm.$style.sassImportModuleNameMapperClass).toBeDefined() - expect(wrapper.vm.$style.sassImportModuleNameMapperClass).toEqual( - 'sassImportModuleNameMapperClass' - ) - }) - it('does inject classes from imports within sass files via moduleNameMapper for more than one rule', () => { - expect( - wrapper.vm.$style.sassImportMultipleModuleNameMapperClass - ).toBeDefined() - expect(wrapper.vm.$style.sassImportMultipleModuleNameMapperClass).toEqual( - 'sassImportMultipleModuleNameMapperClass' - ) - }) - it('does inject classes from imports within sass files imported recursively by relative path', () => { - expect(wrapper.vm.$style.globalClassesRelative).toBeDefined() - expect(wrapper.vm.$style.globalClassesRelative).toEqual( - 'globalClassesRelative' - ) - }) - it('does inject classes from imports within sass files imported recursively via moduleNameMapper', () => { - expect(wrapper.vm.$style.globalClassesModuleNameMapper).toBeDefined() - expect(wrapper.vm.$style.globalClassesModuleNameMapper).toEqual( - 'globalClassesModuleNameMapper' - ) - }) - }) - - describe('multiple modules', () => { - let wrapper - beforeEach(() => { - wrapper = shallowMount(SassModule) - }) - it('does inject classes from sass if multiple modules are present', () => { - expect(wrapper.vm.$style.directImportSecondClass).toBeDefined() - expect(wrapper.vm.$style.directImportSecondClass).toEqual( - 'directImportSecondClass' - ) - }) - }) -}) diff --git a/test/scss.spec.js b/test/scss.spec.js deleted file mode 100644 index 9bab413a..00000000 --- a/test/scss.spec.js +++ /dev/null @@ -1,130 +0,0 @@ -import { shallowMount, mount } from '@vue/test-utils' -import Scss from './resources/Scss.vue' -import ScssModule from './resources/ScssModule.vue' -import ScssModuleFunctional from './resources/ScssModuleFunctional.vue' - -describe('processes .vue file with scss style', () => { - it('does not error on scss', () => { - expect(() => shallowMount(Scss)).not.toThrow() - }) - it('does not error on scss module', () => { - expect(() => shallowMount(ScssModule)).not.toThrow() - }) - it('does not error on scss module when functional', () => { - expect(() => mount(ScssModuleFunctional)).not.toThrow() - }) -}) - -describe('processes .vue files which combine scss and modules', () => { - let wrapper - let functionalWrapper - - beforeEach(() => { - wrapper = shallowMount(ScssModule) - functionalWrapper = mount(ScssModuleFunctional) - }) - - it('does inject classes to $style', () => { - expect(wrapper.vm.$style).toBeDefined() - expect(wrapper.vm.$style.testA).toBeDefined() - expect(wrapper.vm.$style.testA).toEqual('testA') - expect(wrapper.vm.$style.testB).toBeDefined() - expect(wrapper.vm.$style.testB).toEqual('testB') - }) - - it('does inject classes to $style for functional components', () => { - expect(functionalWrapper.findAll('.testAFunctional')).toHaveLength(3) - expect(functionalWrapper.findAll('.testBFunctional')).toHaveLength(2) - expect(functionalWrapper.findAll('.otherTestAFunctional')).toHaveLength(1) - expect(functionalWrapper.findAll('.otherTestBFunctional')).toHaveLength(1) - }) - - describe('entrypoint: direct import in SFC', () => { - let wrapper - beforeEach(() => { - wrapper = shallowMount(ScssModule) - }) - it('does inject classes from directly imported files by relative path', () => { - expect(wrapper.vm.$style.directImportClass).toBeDefined() - expect(wrapper.vm.$style.directImportClass).toEqual('directImportClass') - }) - it('does inject classes from directly imported files via moduleNameMapper', () => { - expect(wrapper.vm.$style.directImportModuleNameMapperClass).toBeDefined() - expect(wrapper.vm.$style.directImportModuleNameMapperClass).toEqual( - 'directImportModuleNameMapperClass' - ) - }) - it('does inject classes from directly imported files via moduleNameMapper for more than one rule', () => { - expect( - wrapper.vm.$style.directImportMultipleModuleNameMapperClass - ).toBeDefined() - expect( - wrapper.vm.$style.directImportMultipleModuleNameMapperClass - ).toEqual('directImportMultipleModuleNameMapperClass') - }) - it('does inject classes from files imported recursively by relative path', () => { - expect(wrapper.vm.$style.globalClassesRelativeDirect).toBeDefined() - expect(wrapper.vm.$style.globalClassesRelativeDirect).toEqual( - 'globalClassesRelativeDirect' - ) - }) - it('does inject classes from files imported recursively via moduleNameMapper', () => { - expect( - wrapper.vm.$style.globalClassesModuleNameMapperDirect - ).toBeDefined() - expect(wrapper.vm.$style.globalClassesModuleNameMapperDirect).toEqual( - 'globalClassesModuleNameMapperDirect' - ) - }) - }) - - describe('entrypoint: import inside previously imported stylesheet', () => { - let wrapper - beforeEach(() => { - wrapper = shallowMount(ScssModule) - }) - it('does inject classes from imports within scss files by relative path', () => { - expect(wrapper.vm.$style.scssImportClass).toBeDefined() - expect(wrapper.vm.$style.scssImportClass).toEqual('scssImportClass') - }) - it('does inject classes from imports within scss files via moduleNameMapper', () => { - expect(wrapper.vm.$style.scssImportModuleNameMapperClass).toBeDefined() - expect(wrapper.vm.$style.scssImportModuleNameMapperClass).toEqual( - 'scssImportModuleNameMapperClass' - ) - }) - it('does inject classes from imports within scss files via moduleNameMapper for more than one rule', () => { - expect( - wrapper.vm.$style.scssImportMultipleModuleNameMapperClass - ).toBeDefined() - expect(wrapper.vm.$style.scssImportMultipleModuleNameMapperClass).toEqual( - 'scssImportMultipleModuleNameMapperClass' - ) - }) - it('does inject classes from imports within scss files imported recursively by relative path', () => { - expect(wrapper.vm.$style.globalClassesRelative).toBeDefined() - expect(wrapper.vm.$style.globalClassesRelative).toEqual( - 'globalClassesRelative' - ) - }) - it('does inject classes from imports within scss files imported recursively via moduleNameMapper', () => { - expect(wrapper.vm.$style.globalClassesModuleNameMapper).toBeDefined() - expect(wrapper.vm.$style.globalClassesModuleNameMapper).toEqual( - 'globalClassesModuleNameMapper' - ) - }) - }) - - describe('multiple modules', () => { - let wrapper - beforeEach(() => { - wrapper = shallowMount(ScssModule) - }) - it('does inject classes from scss if multiple modules are present', () => { - expect(wrapper.vm.$style.directImportSecondClass).toBeDefined() - expect(wrapper.vm.$style.directImportSecondClass).toEqual( - 'directImportSecondClass' - ) - }) - }) -}) diff --git a/test/sourceMaps.spec.js b/test/sourceMaps.spec.js deleted file mode 100644 index b4bd9b98..00000000 --- a/test/sourceMaps.spec.js +++ /dev/null @@ -1,25 +0,0 @@ -import { resolve } from 'path' -import { readFileSync } from 'fs' -import jestVue from '../vue-jest' - -test('generates source maps for .vue files', () => { - const filePath = resolve(__dirname, './resources/Basic.vue') - const fileString = readFileSync(filePath, { encoding: 'utf8' }) - - const { code } = jestVue.process(fileString, filePath, { - moduleFileExtensions: ['js', 'vue'] - }) - - expect(code).toMatchSnapshot() -}) - -test('generates source maps using src attributes', () => { - const filePath = resolve(__dirname, './resources/SourceMapsSrc.vue') - const fileString = readFileSync(filePath, { encoding: 'utf8' }) - - const { code } = jestVue.process(fileString, filePath, { - moduleFileExtensions: ['js', 'vue'] - }) - - expect(code).toMatchSnapshot() -}) diff --git a/test/style.spec.js b/test/style.spec.js deleted file mode 100644 index ea693852..00000000 --- a/test/style.spec.js +++ /dev/null @@ -1,6 +0,0 @@ -import StyleModule from './resources/StyleModule.vue' -import { shallowMount } from '@vue/test-utils' - -test('handles style modules', () => { - shallowMount(StyleModule) -}) diff --git a/test/stylus.spec.js b/test/stylus.spec.js deleted file mode 100644 index 0e2af87b..00000000 --- a/test/stylus.spec.js +++ /dev/null @@ -1,45 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import Stylus from './resources/Stylus.vue' -import StylusRelative from './resources/StylusRelative.vue' -import { resolve } from 'path' -import { readFileSync } from 'fs' -import jestVue from '../vue-jest' - -describe('processes .vue file with Stylus style', () => { - let wrapper - beforeAll(() => { - wrapper = shallowMount(Stylus) - }) - - it('should bind from style tags with named module', () => { - expect(wrapper.classes()).toContain('testA') - }) - - it('should bind from style tags with anonymous modules', () => { - expect(wrapper.classes()).toContain('testB') - }) - - it('should not bind from style tags without a module', () => { - expect(wrapper.vm.$style.testC).toBeFalsy() - }) - - it('should handle relative imports', () => { - expect(() => shallowMount(StylusRelative)).not.toThrow() - }) - - it('does not attempt to compile if experimentalStyles flag is passed', () => { - const filePath = resolve(__dirname, './resources/Basic.vue') - const fileString = readFileSync(filePath, { encoding: 'utf8' }) - const fileStringWithInvalidSass = ` - ${fileString} - - - ` - jestVue.process(fileStringWithInvalidSass, filePath, { - globals: { - 'vue-jest': { experimentalCSSCompile: false } - }, - moduleFileExtensions: ['js', 'vue'] - }) - }) -}) diff --git a/yarn.lock b/yarn.lock index fa644773..87451c1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29,7 +29,7 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@^7.0.0", "@babel/generator@^7.2.2": +"@babel/generator@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.2.2.tgz#18c816c70962640eab42fe8cae5f3947a5c65ccc" integrity sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg== @@ -213,7 +213,7 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3": +"@babel/parser@^7.2.2", "@babel/parser@^7.2.3": version "7.2.3" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.3.tgz#32f5df65744b70888d17872ec106b02434ba1489" integrity sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA== @@ -550,7 +550,7 @@ js-levenshtein "^1.1.3" semver "^5.3.0" -"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": +"@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2": version "7.2.2" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== @@ -559,7 +559,7 @@ "@babel/parser" "^7.2.2" "@babel/types" "^7.2.2" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2", "@babel/traverse@^7.2.3": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.2.2", "@babel/traverse@^7.2.3": version "7.2.3" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" integrity sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw== @@ -616,19 +616,19 @@ dependencies: "@types/babel-types" "*" -"@vue/component-compiler-utils@^2.3.0": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.3.1.tgz#d1c2623f02ad3fe6b6fc9c3762be55c9c61e3977" - integrity sha512-8VuzMhHTf5UU7+HvBeEbBmYiNLvRxIXtDpvxUl5x26WBPgKmQuuJVFY3dN3GFgnWK9Rveh/u/8NF4quhdUUQ1Q== +"@vue/component-compiler-utils@^2.4.0": + version "2.4.0" + resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.4.0.tgz#a887b57ff06e562873a0ba1dfcf1f8068efa6e26" + integrity sha512-LZyagnP+93GPiVHhu6HELEuHaSe83tfVrUgfl3ugwEc/k5yVbMu3OdaWrVqNo4hh1KK8o5fYOk2E/QpsfAxqiQ== dependencies: consolidate "^0.15.1" hash-sum "^1.0.2" lru-cache "^4.1.2" merge-source-map "^1.1.0" - postcss "^6.0.20" - postcss-selector-parser "^3.1.1" + postcss "^7.0.7" + postcss-selector-parser "^5.0.0" prettier "1.13.7" - source-map "^0.5.6" + source-map "^0.7.3" vue-template-es2015-compiler "^1.6.0" "@vue/test-utils@^1.0.0-beta.25": @@ -1034,15 +1034,6 @@ babel-plugin-istanbul@^4.1.6: istanbul-lib-instrument "^1.10.1" test-exclude "^4.2.1" -babel-plugin-istanbul@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz#6892f529eff65a3e2d33d87dc5888ffa2ecd4a30" - integrity sha512-CLoXPRSUWiR8yao8bShqZUIC6qLfZVVY3X1wj+QPNXu0wfmrRRfarh1LYy+dYMVI+bDj0ghy3tuqFFRFZmL1Nw== - dependencies: - find-up "^3.0.0" - istanbul-lib-instrument "^3.0.0" - test-exclude "^5.0.0" - babel-plugin-jest-hoist@^23.2.0: version "23.2.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-23.2.0.tgz#e61fae05a1ca8801aadee57a6d66b8cefaf44167" @@ -1260,13 +1251,6 @@ caller-callsite@^2.0.0: dependencies: callsites "^2.0.0" -caller-path@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" - integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= - dependencies: - callsites "^0.2.0" - caller-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-2.0.0.tgz#468f83044e369ab2010fac5f06ceee15bb2cb1f4" @@ -1274,16 +1258,16 @@ caller-path@^2.0.0: dependencies: caller-callsite "^2.0.0" -callsites@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" - integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= - callsites@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA= +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1428,14 +1412,6 @@ clean-css@^4.1.11: dependencies: source-map "~0.6.0" -clear-module@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/clear-module/-/clear-module-2.1.0.tgz#3508a36e12a47cbd98001e99257d7b0012ebf208" - integrity sha1-NQijbhKkfL2YAB6ZJX17ABLr8gg= - dependencies: - caller-path "^2.0.0" - resolve-from "^3.0.0" - cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -1844,6 +1820,11 @@ css@~1.0.8: css-parse "1.0.4" css-stringify "1.0.5" +cssesc@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-2.0.0.tgz#3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703" + integrity sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg== + cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.4" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" @@ -2074,13 +2055,6 @@ dot-prop@^3.0.0: dependencies: is-obj "^1.0.0" -dot-prop@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" - integrity sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ== - dependencies: - is-obj "^1.0.0" - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -2224,6 +2198,13 @@ eslint-plugin-standard@^4.0.0: resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz#f845b45109c99cd90e77796940a344546c8f6b5c" integrity sha512-OwxJkR6TQiYMmt1EsNRMe5qG3GsbjlcOhbGUBY4LtavF9DsLaTcoR+j2Tdjqi23oUwKNUqX7qcn5fPStafMdlA== +eslint-plugin-vue@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-vue/-/eslint-plugin-vue-5.1.0.tgz#d0d373334be8140d698ec4e1fb83f09faa48081b" + integrity sha512-C7avvbGLb9J1PyGiFolPcGR4ljUc+dKm5ZJdrUKXwXFxHHx4SqOmRI29AsFyW7PbCGcnOvIlaq7NJS6HDIak+g== + dependencies: + vue-eslint-parser "^4.0.2" + eslint-scope@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" @@ -2242,10 +2223,10 @@ eslint-visitor-keys@^1.0.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== -eslint@^5.9.0: - version "5.11.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.11.1.tgz#8deda83db9f354bf9d3f53f9677af7e0e13eadda" - integrity sha512-gOKhM8JwlFOc2acbOrkYR05NW8M6DCMSvfcJiBB5NDxRE1gv8kbvxKaC9u69e6ZGEMWXcswA/7eKR229cEIpvg== +eslint@^5.12.0: + version "5.12.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.12.0.tgz#fab3b908f60c52671fb14e996a450b96c743c859" + integrity sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.5.3" @@ -2264,6 +2245,7 @@ eslint@^5.9.0: glob "^7.1.2" globals "^11.7.0" ignore "^4.0.6" + import-fresh "^3.0.0" imurmurhash "^0.1.4" inquirer "^6.1.0" js-yaml "^3.12.0" @@ -2278,13 +2260,21 @@ eslint@^5.9.0: pluralize "^7.0.0" progress "^2.0.0" regexpp "^2.0.1" - require-uncached "^1.0.3" semver "^5.5.1" strip-ansi "^4.0.0" strip-json-comments "^2.0.1" table "^5.0.2" text-table "^0.2.0" +espree@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.1.0.tgz#728d5451e0fd156c04384a7ad89ed51ff54eb25f" + integrity sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w== + dependencies: + acorn "^6.0.2" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + espree@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.0.tgz#fc7f984b62b36a0f543b13fb9cd7b9f4a7f5b65c" @@ -2621,6 +2611,15 @@ fragment-cache@^0.2.1: dependencies: map-cache "^0.2.2" +fs-extra@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" @@ -2849,7 +2848,7 @@ globule@^1.0.0: lodash "~4.17.10" minimatch "~3.0.2" -graceful-fs@^4.1.11, graceful-fs@^4.1.2: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== @@ -3045,6 +3044,14 @@ import-fresh@^2.0.0: caller-path "^2.0.0" resolve-from "^3.0.0" +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-local@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" @@ -3483,11 +3490,6 @@ istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== -istanbul-lib-coverage@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#2aee0e073ad8c5f6a0b00e0dfbf52b4667472eda" - integrity sha512-nPvSZsVlbG9aLhZYaC3Oi1gT/tpyo3Yt5fNyf6NmcKIayz4VV/txxJFFKAK/gU4dcNn8ehsanBbVHVl0+amOLA== - istanbul-lib-hook@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.2.2.tgz#bc6bf07f12a641fbf1c85391d0daa8f0aea6bf86" @@ -3508,19 +3510,6 @@ istanbul-lib-instrument@^1.10.1, istanbul-lib-instrument@^1.10.2: istanbul-lib-coverage "^1.2.1" semver "^5.3.0" -istanbul-lib-instrument@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.0.0.tgz#b5f066b2a161f75788be17a9d556f40a0cf2afc9" - integrity sha512-eQY9vN9elYjdgN9Iv6NS/00bptm02EBBk70lRMaVjeA6QYocQgenVrSgC28TJurdnZa80AGO3ASdFN+w/njGiQ== - dependencies: - "@babel/generator" "^7.0.0" - "@babel/parser" "^7.0.0" - "@babel/template" "^7.0.0" - "@babel/traverse" "^7.0.0" - "@babel/types" "^7.0.0" - istanbul-lib-coverage "^2.0.1" - semver "^5.5.0" - istanbul-lib-report@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" @@ -4004,6 +3993,13 @@ json5@^0.5.1: resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" @@ -4942,6 +4938,13 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" integrity sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ== +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-github-repo-url@^1.3.0: version "1.4.1" resolved "https://registry.yarnpkg.com/parse-github-repo-url/-/parse-github-repo-url-1.4.1.tgz#9e7d8bb252a6cb6ba42595060b7bf6df3dbc1f50" @@ -5107,23 +5110,23 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= -postcss-selector-parser@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" - integrity sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU= +postcss-selector-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz#249044356697b33b64f1a8f7c80922dddee7195c" + integrity sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ== dependencies: - dot-prop "^4.1.1" + cssesc "^2.0.0" indexes-of "^1.0.1" uniq "^1.0.1" -postcss@^6.0.20: - version "6.0.23" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" - integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag== +postcss@^7.0.7: + version "7.0.7" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-7.0.7.tgz#2754d073f77acb4ef08f1235c36c5721a7201614" + integrity sha512-HThWSJEPkupqew2fnuQMEI2YcTj/8gMV3n80cMdJsKxfIh5tHf7nM5JigNX6LxVMqo6zkgQNAI88hyFvBk41Pg== dependencies: chalk "^2.4.1" source-map "^0.6.1" - supports-color "^5.4.0" + supports-color "^5.5.0" prelude-ls@~1.1.2: version "1.1.2" @@ -5388,14 +5391,6 @@ read-pkg-up@^3.0.0: find-up "^2.0.0" read-pkg "^3.0.0" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -5610,14 +5605,6 @@ require-main-filename@^1.0.1: resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= -require-uncached@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" - integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= - dependencies: - caller-path "^0.1.0" - resolve-from "^1.0.0" - resolve-cwd@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" @@ -5625,16 +5612,16 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" -resolve-from@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" - integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= - resolve-from@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" @@ -5947,6 +5934,11 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@^0.7.3: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + spdx-correct@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" @@ -6169,7 +6161,7 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -supports-color@^5.3.0, supports-color@^5.4.0: +supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== @@ -6229,16 +6221,6 @@ test-exclude@^4.2.1: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" -test-exclude@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.0.0.tgz#cdce7cece785e0e829cd5c2b27baf18bc583cfb7" - integrity sha512-bO3Lj5+qFa9YLfYW2ZcXMOV1pmQvw+KS/DpjqhyX6Y6UZ8zstpZJ+mA2ERkXfpOqhxsJlQiLeVXD3Smsrs6oLw== - dependencies: - arrify "^1.0.1" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^1.0.1" - text-extensions@^1.0.0: version "1.9.0" resolved "https://registry.yarnpkg.com/text-extensions/-/text-extensions-1.9.0.tgz#1853e45fee39c945ce6f6c36b2d659b5aabc2a26" @@ -6491,6 +6473,11 @@ uniq@^1.0.1: resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" integrity sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8= +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" @@ -6556,6 +6543,18 @@ void-elements@^2.0.1, void-elements@~2.0.1: resolved "https://registry.yarnpkg.com/void-elements/-/void-elements-2.0.1.tgz#c066afb582bb1cb4128d60ea92392e94d5e9dbec" integrity sha1-wGavtYK7HLQSjWDqkjkulNXp2+w= +vue-eslint-parser@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/vue-eslint-parser/-/vue-eslint-parser-4.0.3.tgz#80cf162e484387b2640371ad21ba1f86e0c10a61" + integrity sha512-AUeQsYdO6+7QXCems+WvGlrXd37PHv/zcRQSQdY1xdOMwdFAPEnMBsv7zPvk0TPGulXkK/5p/ITgrjiYB7k3ag== + dependencies: + debug "^4.1.0" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + espree "^4.1.0" + esquery "^1.0.1" + lodash "^4.17.11" + vue-template-compiler@^2.4.2: version "2.5.21" resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.21.tgz#a57ceb903177e8f643560a8d639a0f8db647054a"