Skip to content

Commit

Permalink
test: improve test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Aug 6, 2020
1 parent 85beac3 commit cd45012
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions __e2e__/commands/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,26 @@ describe('mevn init', () => {
['init', 'my-app'],
[
`${DOWN}${DOWN}${DOWN}${ENTER}`, // Choose Nuxt.js
`${DOWN}${SPACE}${DOWN}${SPACE}${ENTER}`, // Opt for @nuxtjs/content module
`${DOWN}${SPACE}${DOWN}${SPACE}${ENTER}`, // Opt for @nuxtjs/content and @nuxtjs/pwa modules
`${DOWN}${ENTER}`, // Choose spa as the rendering mode
`${DOWN}${ENTER}`, // Choose static as the deploy target
`Y${ENTER}`, // Requires server directory
],
);

const clientPath = path.join(genPath, 'client');

// nuxt.config.js
const nuxtConfig = require(path.join(clientPath, 'nuxt.config.js')).default;
// Check for Nuxt.js module config

// Check whether the respective entries have been updated
expect(nuxtConfig.buildModules).toContain('@nuxtjs/pwa');
expect(nuxtConfig.modules).toContain('@nuxtjs/content');

// Check for Nuxt.js modules config
expect(nuxtConfig).not.toHaveProperty('axios');
expect(nuxtConfig).toHaveProperty('content');

// Check for rendering mode and deploy target config
expect(nuxtConfig.mode).toBe('spa');
expect(nuxtConfig.target).toBe('static');
Expand Down

0 comments on commit cd45012

Please sign in to comment.