'use strict';

const path = require('path');
const helpers = require('yeoman-test');
const assert = require('yeoman-assert');

module.exports = () => {

  describe('when using json-server', () => {

    before(done => {
      this.generator = helpers
        .run(path.join(__dirname, '../../generators/app'))
        .withPrompts({
          otherModules: 'json-server'
        })
        .toPromise()
        .then(() => done());
    });

    it('should add json-server to the package.json', () => {
      assert.fileContent('package.json', /"json-server"/);
    });

    it('should generate default server files', () => {
      assert.file('json-server/db.json');
      assert.file('json-server/routes.json');
    });

  });

};

@@ -554,16 +554,272 @@
 ver%22/);%0A
+      assert.fileContent('package.json', /%22npm-run-all --parallel serve json-server%22/);%0A    %7D);%0A%0A    it('should add localhost configuration in dev config file', () =%3E %7B%0A      assert.fileContent('src/config/config.dev.json', /%22http:%5C/%5C/localhost:3000%5C/%22/);%0A
     %7D);%0A

add TU