File tree Expand file tree Collapse file tree 3 files changed +1
-45
lines changed
packages/workbox-cli/src/lib
test/workbox-cli/node/lib/questions Expand file tree Collapse file tree 3 files changed +1
-45
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99const inquirer = require ( 'inquirer' ) ;
1010const ol = require ( 'common-tags' ) . oneLine ;
1111
12- const assertValidSWSrc = require ( '../assert-valid-sw-src' ) ;
13-
1412// The key used for the question/answer.
1513const name = 'swSrc' ;
1614
@@ -29,9 +27,5 @@ function askQuestion() {
2927
3028module . exports = async ( ) => {
3129 const answers = await askQuestion ( ) ;
32- const swSrc = answers [ name ] . trim ( ) ;
33-
34- await assertValidSWSrc ( swSrc ) ;
35-
36- return swSrc ;
30+ return answers [ name ] . trim ( ) ;
3731} ;
Original file line number Diff line number Diff line change @@ -15,30 +15,12 @@ const MODULE_PATH = '../../../../../packages/workbox-cli/src/lib/questions/ask-s
1515const QUESTION_NAME = 'swSrc' ;
1616
1717describe ( `[workbox-cli] lib/questions/ask-sw-src.js` , function ( ) {
18- it ( `should reject when the valid SW assertion fails` , async function ( ) {
19- const injectedError = new Error ( 'injected error' ) ;
20- const askSWSrc = proxyquire ( MODULE_PATH , {
21- 'inquirer' : {
22- prompt : ( ) => Promise . resolve ( { [ QUESTION_NAME ] : '' } ) ,
23- } ,
24- '../assert-valid-sw-src' : ( ) => Promise . reject ( injectedError ) ,
25- } ) ;
26-
27- try {
28- await askSWSrc ( ) ;
29- throw new Error ( 'Unexpected success.' ) ;
30- } catch ( error ) {
31- expect ( error ) . to . eql ( injectedError ) ;
32- }
33- } ) ;
34-
3518 it ( `should resolve with a valid answer to the question` , async function ( ) {
3619 const expectedAnswer = 'expected answer' ;
3720 const askSWSrc = proxyquire ( MODULE_PATH , {
3821 'inquirer' : {
3922 prompt : ( ) => Promise . resolve ( { [ QUESTION_NAME ] : expectedAnswer } ) ,
4023 } ,
41- '../assert-valid-sw-src' : ( ) => Promise . resolve ( ) ,
4224 } ) ;
4325
4426 const answer = await askSWSrc ( ) ;
You can’t perform that action at this time.
0 commit comments