Skip to content

Commit 427296b

Browse files
committed
fix: hide ava for vue-sfc, it doesn't work yet
1 parent 15e5fe5 commit 427296b

4 files changed

Lines changed: 24 additions & 4 deletions

File tree

questions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ module.exports = [
3939
{value: 'jasmine', title: 'Jasmine', hint: 'Runs in browser, a behavior-driven testing framework.'},
4040
{value: 'mocha', title: 'Mocha + Chai', hint: 'Runs in browser, a feature-rich JavaScript test framework for node and browsers.'},
4141
{value: 'tape', title: 'Tape', hint: 'Runs in browser, tap-producing test harness for node and browsers.'},
42-
{if: '!aurelia', value: 'ava', title: 'Ava + browser-env', hint: 'Runs in Node.js, simulates browser (browser-env). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'},
42+
// TODO ava and vue sfc is not yet working.
43+
// See vue/test/setup.ext for more details
44+
{if: '!aurelia && !sfc', value: 'ava', title: 'Ava + browser-env', hint: 'Runs in Node.js, simulates browser (browser-env). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'},
4345
{if: 'aurelia', value: 'ava', title: 'Ava', hint: 'Runs in Node.js, simulates browser (aurelia-pal-nodejs). A test runner for Node.js with a concise API, detailed error output, embrace of new language features and process isolation that let you write tests more effectively.'}
4446
]
4547
},

test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,17 @@ const skeletons = [
178178
'vue sfc babel css jasmine cypress',
179179
'vue sfc babel css tape cypress',
180180
'vue sfc babel css mocha cypress',
181-
'vue sfc babel css ava cypress',
181+
// 'vue sfc babel css ava cypress',
182182
'vue sfc babel less jest cypress',
183183
'vue sfc babel less jasmine cypress',
184184
'vue sfc babel less tape cypress',
185185
'vue sfc babel less mocha cypress',
186-
'vue sfc babel less ava cypress',
186+
// 'vue sfc babel less ava cypress',
187187
'vue sfc babel sass jest cypress',
188188
'vue sfc babel sass jasmine cypress',
189189
'vue sfc babel sass tape cypress',
190190
'vue sfc babel sass mocha cypress',
191-
'vue sfc babel sass ava cypress',
191+
// 'vue sfc babel sass ava cypress',
192192

193193
];
194194

vue/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
// @if ava
1414
"jsdom": "^15.1.1",
1515
"jsdom-global": "^3.0.2",
16+
// @if sfc
17+
"require-extension-hooks": "^0.3.3",
18+
"require-extension-hooks-vue": "^3.0.0",
19+
"require-extension-hooks-babel": "^1.0.0",
20+
// @endif
1621
// @endif
1722
}
1823
}

vue/test/setup.ext

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ import 'regenerator-runtime/runtime';
44
// @endif
55
// @if ava
66
import 'jsdom-global/register';
7+
// @if sfc
8+
// TODO ava and vue sfc is not yet working.
9+
import hooks from 'require-extension-hooks';
10+
import Vue from 'vue';
11+
12+
// Setup Vue.js to remove production tip
13+
Vue.config.productionTip = false;
14+
15+
// Setup vue files to be processed by `require-extension-hooks-vue`
16+
hooks('vue').plugin('vue').push();
17+
// Setup vue and js files to be processed by `require-extension-hooks-babel`
18+
hooks(['vue', 'js']).exclude(({filename}) => filename.match(/\/node_modules\//)).plugin('babel').push();
19+
// @endif
720

821
// ignore css modules
922
function skipCSS(module) {

0 commit comments

Comments
 (0)