MCPcopy Create free account
hub / github.com/bigcommerce/stencil-cli / getQuestions

Function getQuestions

lib/stencil-init.spec.js:39–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 apiHost: API_HOST,
38});
39const getQuestions = () => [
40 {
41 type: 'input',
42 name: 'normalStoreUrl',
43 message: "What is the URL of your store's home page?",
44 validate: (val) => /^https?:\/\//.test(val) || 'You must enter a URL',
45 default: 'https://url-from-answers.mybigcommerce.com',
46 },
47 {
48 type: 'input',
49 name: 'accessToken',
50 message: 'What is your Stencil OAuth Access Token?',
51 default: 'accessToken_from_answers',
52 filter: (val) => val.trim(),
53 },
54 {
55 type: 'input',
56 name: 'port',
57 message: 'What port would you like to run the server on?',
58 default: 3003,
59 validate: (val) => {
60 if (Number.isNaN(val)) {
61 return 'You must enter an integer';
62 }
63 if (val < 1024 || val > 65535) {
64 return 'The port number must be between 1025 and 65535';
65 }
66 return true;
67 },
68 },
69 {
70 type: 'list',
71 name: 'packageManager',
72 message: 'What is your favourite Package Manager?',
73 choices: ['npm', 'yarn', 'pnpm'],
74 default: 'npm',
75 },
76];
77const getNypmStub = () => ({
78 installDependencies: jest.fn().mockResolvedValue(true),
79});

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected