Skip to content

Commit

Permalink
test: fix failing test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Aug 11, 2020
1 parent 03cbf29 commit 054bad6
Showing 1 changed file with 4 additions and 38 deletions.
42 changes: 4 additions & 38 deletions __e2e__/commands/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,57 +84,23 @@ describe('mevn init', () => {
rmTempDir(genPath);
});

it('creates a new MEVN stack webapp based on the Default starter template', async () => {
it('creates a new MEVN stack webapp based on the GraphQL starter template', async () => {
await runPromptWithAnswers(
['init', 'my-app'],
[
ENTER, // Choose Default as the starter template
`${DOWN}${DOWN}${ENTER}`, // Choose GraphQL as the starter template
`Y${ENTER}`, // Requires server directory
],
tempDirPath,
);

expect(fetchProjectConfig(genPath).template).toBe('Default');
expect(fetchProjectConfig(genPath).template).toBe('GraphQL');

// Rename .mevngitignore to .gitignore
expect(fs.existsSync(path.join(clientPath, '.mevngitignore'))).toBeFalsy();
expect(fs.existsSync(path.join(clientPath, '.gitignore'))).toBeTruthy();

// Check whether if the respective directories have been generated
expect(fs.existsSync(path.join(serverPath, 'routes'))).toBeTruthy();
expect(fs.existsSync(path.join(serverPath, 'views'))).toBeTruthy();

// Delete the generated directory
rmTempDir(genPath);
});

it('creates a new MEVN stack webapp based on the PWA starter template', async () => {
await runPromptWithAnswers(
['init', 'my-app'],
[
`${DOWN}${ENTER}`, // Choose PWA as the starter template
`Y${ENTER}`, // Requires server directory
],
tempDirPath,
);

expect(fetchProjectConfig(genPath).template).toBe('PWA');

// Delete the generated directory
rmTempDir(genPath);
});

it('creates a new MEVN stack webapp based on the GraphQL starter template', async () => {
await runPromptWithAnswers(
['init', 'my-app'],
[
`${DOWN}${DOWN}${ENTER}`, // Choose GraphQL as the starter template
`Y${ENTER}`, // Requires server directory
],
tempDirPath,
);

expect(fetchProjectConfig(genPath).template).toBe('GraphQL');
// Check whether if the respective directory have been generated
expect(fs.existsSync(path.join(serverPath, 'graphql'))).toBeTruthy();
});
});

0 comments on commit 054bad6

Please sign in to comment.