-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.js
More file actions
16 lines (13 loc) · 609 Bytes
/
test.js
File metadata and controls
16 lines (13 loc) · 609 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const cli = require('./utils/cli');
test('CLI function should return undefined', async () => {
const cliPrompt = await cli('how to sort list in python', []);
expect(typeof cliPrompt).toEqual('undefined');
});
test('Check user input for empty string without flags', async () => {
const cliPrompt = await cli('', []);
expect(cliPrompt).toEqual('You did not enter a question. Please enter one');
});
test('Check user input for empty string with flags', async () => {
const cliPrompt = await cli('', ['--asc', '--votes']);
expect(cliPrompt).toEqual('You did not enter a question. Please enter one');
});