text: // IMPORTANT
  // This snapshot file is auto-generated, but designed for humans.
  // It should be checked into source control and tracked carefully.
  // Re-generate by setting UPDATE_SNAPSHOTS=1 and running tests.
  // Make sure to inspect the changes in the snapshots below.
  // Do not ignore changes!
  
  'use strict';
  
  exports[`app-generator specific files creates .mocharc.json 1`] = `
  {
    "exit": true,
    "recursive": true,
    "require": "source-map-support/register"
  }
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 1`] = `
  # my-app
  
  This application is generated using [LoopBack 4 CLI](https://loopback.io/doc/en/lb4/Command-line-interface.html) with the
  [initial project layout](https://loopback.io/doc/en/lb4/Loopback-application-layout.html).
  
  ## Install dependencies
  
  By default, dependencies were installed when this application was generated.
  Whenever dependencies in \`package.json\` are changed, run the following command:
  
  \`\`\`sh
  npm install
  \`\`\`
  
  To only install resolved dependencies in \`package-lock.json\`:
  
  \`\`\`sh
  npm ci
  \`\`\`
  
  ## Run the application
  
  \`\`\`sh
  npm start
  \`\`\`
  
  You can also run \`node .\` to skip the build step.
  
  Open http://127.0.0.1:3000 in your browser.
  
  ## Rebuild the project
  
  To incrementally build the project:
  
  \`\`\`sh
  npm run build
  \`\`\`
  
  To force a full build by cleaning up cached artifacts:
  
  \`\`\`sh
  npm run rebuild
  \`\`\`
  
  ## Fix code style and formatting issues
  
  \`\`\`sh
  npm run lint
  \`\`\`
  
  To automatically fix such issues:
  
  \`\`\`sh
  npm run lint:fix
  \`\`\`
  
  ## Other useful commands
  
  - \`npm run migrate\`: Migrate database schemas for models
  - \`npm run openapi-spec\`: Generate OpenAPI spec into a file
  - \`npm run docker:build\`: Build a Docker image for this application
  - \`npm run docker:run\`: Run this application inside a Docker container
  
  ## Tests
  
  \`\`\`sh
  npm test
  \`\`\`
  
  ## What's next
  
  Please check out [LoopBack 4 documentation](https://loopback.io/doc/en/lb4/) to
  understand how you can continue to add features to this application.
  
  [![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)-@2x.png)](http://loopback.io/)
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 2`] = `
  import {BootMixin} from '@loopback/boot';
  import {ApplicationConfig} from '@loopback/core';
  import {
    RestExplorerBindings,
    RestExplorerComponent,
  } from '@loopback/rest-explorer';
  import {RepositoryMixin} from '@loopback/repository';
  import {RestApplication} from '@loopback/rest';
  import {ServiceMixin} from '@loopback/service-proxy';
  import path from 'path';
  import {MySequence} from './sequence';
  
  export {ApplicationConfig};
  
  export class MyAppApplication extends BootMixin(
    ServiceMixin(RepositoryMixin(RestApplication)),
  ) {
    constructor(options: ApplicationConfig = {}) {
      super(options);
  
      // Set up the custom sequence
      this.sequence(MySequence);
  
      // Set up default home page
      this.static('/', path.join(__dirname, '../public'));
  
      // Customize @loopback/rest-explorer configuration here
      this.configure(RestExplorerBindings.COMPONENT).to({
        path: '/explorer',
      });
      this.component(RestExplorerComponent);
  
      this.projectRoot = __dirname;
      // Customize @loopback/boot Booter Conventions here
      this.bootOptions = {
        controllers: {
          // Customize ControllerBooter Conventions here
          dirs: ['controllers'],
          extensions: ['.controller.js'],
          nested: true,
        },
      };
    }
  }
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 3`] = `
  import {MiddlewareSequence} from '@loopback/rest';
  
  export class MySequence extends MiddlewareSequence {}
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 4`] = `
  import {ApplicationConfig, MyAppApplication} from './application';
  
  export * from './application';
  
  export async function main(options: ApplicationConfig = {}) {
    const app = new MyAppApplication(options);
    await app.boot();
    await app.start();
  
    const url = app.restServer.url;
    console.log(\`Server is running at \${url}\`);
    console.log(\`Try \${url}/ping\`);
  
    return app;
  }
  
  if (require.main === module) {
    // Run the application
    const config = {
      rest: {
        port: +(process.env.PORT ?? 3000),
        host: process.env.HOST,
        // The \`gracePeriodForClose\` provides a graceful close for http/https
        // servers with keep-alive clients. The default value is \`Infinity\`
        // (don't force-close). If you want to immediately destroy all sockets
        // upon stop, set its value to \`0\`.
        // See https://www.npmjs.com/package/stoppable
        gracePeriodForClose: 5000, // 5 seconds
        openApiSpec: {
          // useful when used with OpenAPI-to-GraphQL to locate your application
          setServersFromRequest: true,
        },
      },
    };
    main(config).catch(err => {
      console.error('Cannot start the application.', err);
      process.exit(1);
    });
  }
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 5`] = `
  import {inject} from '@loopback/core';
  import {
    Request,
    RestBindings,
    get,
    response,
    ResponseObject,
  } from '@loopback/rest';
  
  /**
   * OpenAPI response for ping()
   */
  const PING_RESPONSE: ResponseObject = {
    description: 'Ping Response',
    content: {
      'application/json': {
        schema: {
          type: 'object',
          title: 'PingResponse',
          properties: {
            greeting: {type: 'string'},
            date: {type: 'string'},
            url: {type: 'string'},
            headers: {
              type: 'object',
              properties: {
                'Content-Type': {type: 'string'},
              },
              additionalProperties: true,
            },
          },
        },
      },
    },
  };
  
  /**
   * A simple controller to bounce back http requests
   */
  export class PingController {
    constructor(@inject(RestBindings.Http.REQUEST) private req: Request) {}
  
    // Map to \`GET /ping\`
    @get('/ping')
    @response(200, PING_RESPONSE)
    ping(): object {
      // Reply with a greeting, the current time, the url, and request headers
      return {
        greeting: 'Hello from LoopBack',
        date: new Date(),
        url: this.req.url,
        headers: Object.assign({}, this.req.headers),
      };
    }
  }
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 6`] = `
  import {Client, expect} from '@loopback/testlab';
  import {MyAppApplication} from '../..';
  import {setupApplication} from './test-helper';
  
  describe('PingController', () => {
    let app: MyAppApplication;
    let client: Client;
  
    before('setupApplication', async () => {
      ({app, client} = await setupApplication());
    });
  
    after(async () => {
      await app.stop();
    });
  
    it('invokes GET /ping', async () => {
      const res = await client.get('/ping?msg=world').expect(200);
      expect(res.body).to.containEql({greeting: 'Hello from LoopBack'});
    });
  });
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 7`] = `
  import {Client} from '@loopback/testlab';
  import {MyAppApplication} from '../..';
  import {setupApplication} from './test-helper';
  
  describe('HomePage', () => {
    let app: MyAppApplication;
    let client: Client;
  
    before('setupApplication', async () => {
      ({app, client} = await setupApplication());
    });
  
    after(async () => {
      await app.stop();
    });
  
    it('exposes a default home page', async () => {
      await client
        .get('/')
        .expect(200)
        .expect('Content-Type', /text\\/html/);
    });
  
    it('exposes self-hosted explorer', async () => {
      await client
        .get('/explorer/')
        .expect(200)
        .expect('Content-Type', /text\\/html/)
        .expect(/<title>LoopBack API Explorer/);
    });
  });
  
  `;
  
  
  exports[`app-generator specific files generates all the proper files 8`] = `
  import {MyAppApplication} from '../..';
  import {
    createRestAppClient,
    givenHttpServerConfig,
    Client,
  } from '@loopback/testlab';
  
  export async function setupApplication(): Promise<AppWithClient> {
    const restConfig = givenHttpServerConfig({
      // Customize the server configuration here.
      // Empty values (undefined, '') will be ignored by the helper.
      //
      // host: process.env.HOST,
      // port: +process.env.PORT,
    });
  
    const app = new MyAppApplication({
      rest: restConfig,
    });
  
    await app.boot();
    await app.start();
  
    const client = createRestAppClient(app);
  
    return {app, client};
  }
  
  export interface AppWithClient {
    app: MyAppApplication;
    client: Client;
  }
  
  `;
  
  
  exports[`app-generator specific files generates database migration script 1`] = `
  import {MyAppApplication} from './application';
  
  export async function migrate(args: string[]) {
    const existingSchema = args.includes('--rebuild') ? 'drop' : 'alter';
    console.log('Migrating schemas (%s existing schema)', existingSchema);
  
    const app = new MyAppApplication();
    await app.boot();
    await app.migrateSchema({existingSchema});
  
    // Connectors usually keep a pool of opened connections,
    // this keeps the process running even after all work is done.
    // We need to exit explicitly.
    process.exit(0);
  }
  
  migrate(process.argv).catch(err => {
    console.error('Cannot migrate database schema', err);
    process.exit(1);
  });
  
  `;
  
  
  exports[`app-generator specific files generates docker files 1`] = `
  # Check out https://hub.docker.com/_/node to select a new base image
  FROM node:10-slim
  
  # Set to a non-root built-in user \`node\`
  USER node
  
  # Create app directory (with user \`node\`)
  RUN mkdir -p /home/node/app
  
  WORKDIR /home/node/app
  
  # Install app dependencies
  # A wildcard is used to ensure both package.json AND package-lock.json are copied
  # where available (npm@5+)
  COPY --chown=node package*.json ./
  
  RUN npm install
  
  # Bundle app source code
  COPY --chown=node . .
  
  RUN npm run build
  
  # Bind to all network interfaces so that it can be mapped to the host OS
  ENV HOST=0.0.0.0 PORT=3000
  
  EXPOSE \${PORT}
  CMD [ "node", "." ]
  
  `;
  
  
  exports[`app-generator specific files generates docker files 2`] = `
  node_modules
  npm-debug.log
  /dist
  # Cache used by TypeScript's incremental build
  *.tsbuildinfo
  
  `;
  
  
  exports[`app-generator specific files generates openapi spec script 1`] = `
  import {ApplicationConfig} from '@loopback/core';
  import {MyAppApplication} from './application';
  
  /**
   * Export the OpenAPI spec from the application
   */
  async function exportOpenApiSpec(): Promise<void> {
    const config: ApplicationConfig = {
      rest: {
        port: +(process.env.PORT ?? 3000),
        host: process.env.HOST ?? 'localhost',
      },
    };
    const outFile = process.argv[2] ?? '';
    const app = new MyAppApplication(config);
    await app.boot();
    await app.exportOpenApiSpec(outFile);
  }
  
  exportOpenApiSpec().catch(err => {
    console.error('Fail to export OpenAPI spec from the application.', err);
    process.exit(1);
  });
  
  `;
  
  
  exports[`app-generator with --apiconnect adds imports for ApiConnectComponent 1`] = `
  import {BootMixin} from '@loopback/boot';
  import {ApplicationConfig} from '@loopback/core';
  import {
    RestExplorerBindings,
    RestExplorerComponent,
  } from '@loopback/rest-explorer';
  import {RepositoryMixin} from '@loopback/repository';
  import {RestApplication} from '@loopback/rest';
  import {ServiceMixin} from '@loopback/service-proxy';
  import {
    ApiConnectBindings,
    ApiConnectComponent,
    ApiConnectSpecOptions,
  } from '@loopback/apiconnect';
  import path from 'path';
  import {MySequence} from './sequence';
  
  export {ApplicationConfig};
  
  export class MyAppApplication extends BootMixin(
    ServiceMixin(RepositoryMixin(RestApplication)),
  ) {
    constructor(options: ApplicationConfig = {}) {
      super(options);
  
      // Set up the custom sequence
      this.sequence(MySequence);
  
      // Set up default home page
      this.static('/', path.join(__dirname, '../public'));
  
      // Customize @loopback/rest-explorer configuration here
      this.configure(RestExplorerBindings.COMPONENT).to({
        path: '/explorer',
      });
      this.component(RestExplorerComponent);
      this.component(ApiConnectComponent);
      const apiConnectOptions: ApiConnectSpecOptions = {
        targetUrl: 'http://localhost:3000/',
      };
      this.configure(ApiConnectBindings.API_CONNECT_SPEC_ENHANCER).to(
        apiConnectOptions,
      );
  
      this.projectRoot = __dirname;
      // Customize @loopback/boot Booter Conventions here
      this.bootOptions = {
        controllers: {
          // Customize ControllerBooter Conventions here
          dirs: ['controllers'],
          extensions: ['.controller.js'],
          nested: true,
        },
      };
    }
  }
  
  `;
  
  
  exports[`app-generator with --applicationName generates all the proper files 1`] = `
  import {BootMixin} from '@loopback/boot';
  import {ApplicationConfig} from '@loopback/core';
  import {
    RestExplorerBindings,
    RestExplorerComponent,
  } from '@loopback/rest-explorer';
  import {RepositoryMixin} from '@loopback/repository';
  import {RestApplication} from '@loopback/rest';
  import {ServiceMixin} from '@loopback/service-proxy';
  import path from 'path';
  import {MySequence} from './sequence';
  
  export {ApplicationConfig};
  
  export class MyApp extends BootMixin(
    ServiceMixin(RepositoryMixin(RestApplication)),
  ) {
    constructor(options: ApplicationConfig = {}) {
      super(options);
  
      // Set up the custom sequence
      this.sequence(MySequence);
  
      // Set up default home page
      this.static('/', path.join(__dirname, '../public'));
  
      // Customize @loopback/rest-explorer configuration here
      this.configure(RestExplorerBindings.COMPONENT).to({
        path: '/explorer',
      });
      this.component(RestExplorerComponent);
  
      this.projectRoot = __dirname;
      // Customize @loopback/boot Booter Conventions here
      this.bootOptions = {
        controllers: {
          // Customize ControllerBooter Conventions here
          dirs: ['controllers'],
          extensions: ['.controller.js'],
          nested: true,
        },
      };
    }
  }
  
  `;
  
  
  exports[`app-generator with --applicationName generates the application with RepositoryMixin 1`] = `
  import {BootMixin} from '@loopback/boot';
  import {ApplicationConfig} from '@loopback/core';
  import {
    RestExplorerBindings,
    RestExplorerComponent,
  } from '@loopback/rest-explorer';
  import {RepositoryMixin} from '@loopback/repository';
  import {RestApplication} from '@loopback/rest';
  import {ServiceMixin} from '@loopback/service-proxy';
  import path from 'path';
  import {MySequence} from './sequence';
  
  export {ApplicationConfig};
  
  export class MyApp extends BootMixin(
    ServiceMixin(RepositoryMixin(RestApplication)),
  ) {
    constructor(options: ApplicationConfig = {}) {
      super(options);
  
      // Set up the custom sequence
      this.sequence(MySequence);
  
      // Set up default home page
      this.static('/', path.join(__dirname, '../public'));
  
      // Customize @loopback/rest-explorer configuration here
      this.configure(RestExplorerBindings.COMPONENT).to({
        path: '/explorer',
      });
      this.component(RestExplorerComponent);
  
      this.projectRoot = __dirname;
      // Customize @loopback/boot Booter Conventions here
      this.bootOptions = {
        controllers: {
          // Customize ControllerBooter Conventions here
          dirs: ['controllers'],
          extensions: ['.controller.js'],
          nested: true,
        },
      };
    }
  }
  
  `;
  