This commit is contained in:
parent
beba61e4e2
commit
94e2eb76cd
1 changed files with 5 additions and 5 deletions
|
@ -70,28 +70,28 @@ describe('subreddit', () => {
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
test('GIVEN -s is supplied, EXPECT subreddit to be changed', async () => {
|
test('GIVEN -s is supplied, EXPECT subreddit to be changed', async () => {
|
||||||
const result = await cli(['-s', 'horses'], '.');
|
const result = await cli(['-s', 'pics'], '.');
|
||||||
|
|
||||||
const subreddit = result.stdout.split('\n')
|
const subreddit = result.stdout.split('\n')
|
||||||
.find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')!
|
.find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')!
|
||||||
.split(' = ')[1];
|
.split(' = ')[1];
|
||||||
|
|
||||||
expect(subreddit).toBe('Horses');
|
expect(subreddit).toBe('pics');
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
test('GIVEN --subreddit is supplied, EXPECT subreddit to be changed', async () => {
|
test('GIVEN --subreddit is supplied, EXPECT subreddit to be changed', async () => {
|
||||||
const result = await cli(['--subreddit', 'horses'], '.');
|
const result = await cli(['--subreddit', 'pics'], '.');
|
||||||
|
|
||||||
const subreddit = result.stdout.split('\n')
|
const subreddit = result.stdout.split('\n')
|
||||||
.find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')!
|
.find(x => x && x.length > 0 && x.split(' = ')[0] == 'Subreddit')!
|
||||||
.split(' = ')[1];
|
.split(' = ')[1];
|
||||||
|
|
||||||
expect(subreddit).toBe('Horses');
|
expect(subreddit).toBe('pics');
|
||||||
}, 5000);
|
}, 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('sort', () => {
|
describe('sort', () => {
|
||||||
test('GIVEN --sort is not supplird, EXPECT sort to be defaulted', async () => {
|
test('GIVEN --sort is not supplied, EXPECT sort to be defaulted', async () => {
|
||||||
const result = await cli(['-q'], '.');
|
const result = await cli(['-q'], '.');
|
||||||
|
|
||||||
const sortBy = result.stdout.split('\n')
|
const sortBy = result.stdout.split('\n')
|
||||||
|
|
Loading…
Reference in a new issue