Files
Jeffrey PosnickandGitHub 7d4c4434a4 Enable prettier (#2929)
* Deps and config

* Prettier output

* Update hardcoded file sizes

* More file size updates
2021-08-26 14:57:20 -07:00

31 lines
966 B
JavaScript

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
const expect = require('chai').expect;
const proxyquire = require('proxyquire');
const MODULE_PATH =
'../../../../../packages/workbox-cli/build/lib/questions/ask-sw-src';
// This is the hardcoded name of the question that's passed to inquirer.
// It's used as the key to read the response from the answer.
const QUESTION_NAME = 'swSrc';
describe(`[workbox-cli] lib/questions/ask-sw-src.js`, function () {
it(`should resolve with a valid answer to the question`, async function () {
const expectedAnswer = 'expected answer';
const {askSWSrc} = proxyquire(MODULE_PATH, {
inquirer: {
prompt: () => Promise.resolve({[QUESTION_NAME]: expectedAnswer}),
},
});
const answer = await askSWSrc();
expect(answer).to.eql(expectedAnswer);
});
});