diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..bebe60a --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,23 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 14 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security + - critical + - p1 + - major +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: > + This issue has been closed due to continued inactivity. Thank you for your understanding. + If you believe this to be in error, please contact one of the code owners, + listed in the `CODEOWNERS` file at the top-level of this repository. diff --git a/.gitignore b/.gitignore index e525285..38add57 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ node_modules *xunit.xml test/sandbox/ test/fixtures/actual +.vscode/* diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/.travis.yml b/.travis.yml index c60f507..a74acf2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ sudo: false language: node_js node_js: - - "6" - "8" - "10" diff --git a/CHANGES.md b/CHANGES.md index 7c4a2d7..888e4e7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,65 @@ +2021-01-19, Version 5.2.0 +========================= + + * Reword end-of-life warning printed by CLI (Miroslav Bajtoš) + + * chore: update LTS status to End-of-Life (Rifa Achrinza) + + * fix: warning about LoopBack 3 in stderr (HugoPoi) + + +2020-03-05, Version 5.1.0 +========================= + + * Print a warning about Maintenance LTS at startup (Miroslav Bajtoš) + + * Update LTS status in README (Miroslav Bajtoš) + + * chore: update copyright year (Diana Lau) + + * chore: drop Node.js 6 support (Diana Lau) + + +2019-06-20, Version 5.0.3 +========================= + + * fix: a workaround to fix the hanging cmd (jannyHou) + + +2019-05-15, Version 5.0.2 +========================= + + * fix tests for prompts (Diana Lau) + + +2019-05-10, Version 5.0.1 +========================= + + * chore: update copyright years (Diana Lau) + + * chore: update LTS status (Diana Lau) + + * LTS (jannyHou) + + +2018-11-16, Version 5.0.0 +========================= + + * feat: switch to yeoman-env (jannyHou) + + * chore: add stalebot (Diana Lau) + + +2018-09-18, Version 4.2.1 +========================= + + * chore: upgrade dependencies (virkt25) + + * Fix tests on printing help (shimks) + + * Drop node 4 from CI (shimks) + + 2018-03-22, Version 4.2.0 ========================= diff --git a/CODEOWNERS b/CODEOWNERS index 9f029e0..ab41b34 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,6 +1,6 @@ # Lines starting with '#' are comments. # Each line is a file pattern followed by one or more owners, -# the last matching pattern has the most precendence. +# the last matching pattern has the most precedence. # Core team members from IBM -* @bajtos @raymondfend @rashmihunt @hacksparrow +* @bajtos @raymondfeng @rashmihunt @hacksparrow diff --git a/README.md b/README.md index 3312319..c7d8e0e 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,16 @@ LoopBack CLI tool for creating projects, models and more. This package supersedes the older `slc` tool. +**⚠️ LoopBack 3 has reached end of life. We are no longer accepting pull requests or providing +support for community users. The only exception is fixes for critical bugs and security +vulnerabilities provided as part of support for IBM API Connect customers. (See +[Module Long Term Support Policy](#module-long-term-support-policy) below.)** + +We urge all LoopBack 3 users to migrate their applications to LoopBack 4 as +soon as possible. Refer to our +[Migration Guide](https://loopback.io/doc/en/lb4/migration-overview.html) +for more information on how to upgrade. + ## Installation To install the LoopBack CLI tool: @@ -85,3 +95,14 @@ Discuss features and ask questions on ## License MIT + +## Module Long Term Support Policy +This module adopts the [Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy, with the following End Of Life (EOL) dates: + +| Version | Status | Published | EOL | +| ------- | --------------- | --------- | -------- | +| 5.x | End-of-Life | Nov 2018 | Dec 2020 | +| 4.x | End-of-Life | Sep 2017 | Dec 2019 | +| 3.x | End-of-Life | Jul 2017 | Apr 2019 | + +Learn more about our LTS plan in the [docs](https://loopback.io/doc/en/contrib/Long-term-support.html). diff --git a/bin/loopback-cli.js b/bin/loopback-cli.js index 0556425..9b33bad 100755 --- a/bin/loopback-cli.js +++ b/bin/loopback-cli.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -// Copyright IBM Corp. 2016. All Rights Reserved. +// Copyright IBM Corp. 2016,2019. All Rights Reserved. // Node module: loopback-cli // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT @@ -8,10 +8,22 @@ const assert = require('assert'); const camelCaseKeys = require('camelcase-keys'); +const chalk = require('ansi-colors'); const debug = require('debug')('loopback:cli'); const minimist = require('minimist'); const path = require('path'); +console.error(chalk.bold(chalk.red(` +LoopBack 3 has reached end of life. We are no longer accepting pull requests +or providing support for community users. The only exception is fixes for +critical bugs and security vulnerabilities provided as part of support for +IBM API Connect customers. + +We urge all LoopBack 3 users to migrate their applications to LoopBack 4 +as soon as possible. Refer to our Migration Guide for more information +on how to upgrade: https://loopback.io/doc/en/lb4/migration-overview.html +`))); + const opts = minimist(process.argv.slice(2), { alias: { help: 'h', @@ -36,10 +48,10 @@ process.env.SLC_COMMAND = 'loopback-cli'; // therefore I am intentionally loading it only after we have // handled the "--version" case which becomes much faster as the result. const lbGenerator = require('generator-loopback'); -const yeoman = lbGenerator._yeoman; // generator-loopback should export _yeoman -assert(yeoman, 'generator-loopback should export _yeoman'); +const yeomanEnv = lbGenerator._yeomanEnv; +assert(yeomanEnv, 'generator-loopback should export _yeomanEnv'); -const env = yeoman(); +const env = yeomanEnv.createEnv(); // Change the working directory to the generator-loopback module so that // yeoman can discover the generators @@ -48,41 +60,39 @@ const cwd = process.cwd(); debug('changing directory to %s', root); process.chdir(root); -// lookup for every namespaces, within the environments.paths and lookups -env.lookup(); -debug('changing directory back to %s', cwd); -process.chdir(cwd); // Switch back - -// list generators -if (opts.commands) { - console.log('Available commands: '); - var list = Object.keys(env.getGeneratorsMeta()) - .filter(name => /^loopback:/.test(name)) - .map(name => name.replace(/^loopback:/, ' lb ')); - console.log(list.join('\n')); - return; -} - -const args = opts._; -const originalCommand = args.shift(); -let command = 'loopback:' + (originalCommand || 'app'); -const supportedCommands = env.getGeneratorsMeta(); - -if (!(command in supportedCommands)) { - command = 'loopback:app'; - args.unshift(originalCommand); - args.unshift(command); -} else { - args.unshift(command); -} - -debug('invoking generator', args); - -// `yo` is adding flags converted to CamelCase -const options = camelCaseKeys(opts, {exclude: ['--', /^\w$/, 'argv']}); -Object.assign(options, opts); - -const generator = env.create(command, {args}); - -debug('env.run %j %j', args, options); -env.run(args, options); +env.lookup(function() { + debug('changing directory back to %s', cwd); + process.chdir(cwd); // Switch back + + // list generators + if (opts.commands) { + console.log('Available commands: '); + var list = Object.keys(env.getGeneratorsMeta()) + .filter(name => /^loopback:/.test(name)) + .map(name => name.replace(/^loopback:/, ' lb ')); + console.log(list.join('\n')); + return; + } + + const args = opts._; + const originalCommand = args.shift(); + let command = 'loopback:' + (originalCommand || 'app'); + const supportedCommands = env.getGeneratorsMeta(); + + if (!(command in supportedCommands)) { + command = 'loopback:app'; + args.unshift(originalCommand); + args.unshift(command); + } else { + args.unshift(command); + } + + debug('invoking generator', args); + + // `yo` is adding flags converted to CamelCase + const options = camelCaseKeys(opts, {exclude: ['--', /^\w$/, 'argv']}); + Object.assign(options, opts); + + debug('env.run %j %j', args, options); + env.run(args, options); +}); diff --git a/package.json b/package.json index fdf33d5..3bdb5b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "loopback-cli", - "version": "4.2.0", + "version": "5.2.0", "description": "LoopBack CLI tool for creating projects, models and more.", "license": "MIT", "homepage": "http://loopback.io", @@ -8,8 +8,9 @@ "LoopBack", "StrongLoop" ], + "author": "IBM Corp.", "engines": { - "node": ">=6" + "node": ">=8" }, "repository": { "type": "git", @@ -29,18 +30,20 @@ } }, "dependencies": { - "camelcase-keys": "^4.0.0", - "debug": "^2.6.1", - "generator-loopback": "^5.5.1", + "ansi-colors": "^4.1.1", + "camelcase-keys": "^4.2.0", + "debug": "^4.0.1", + "generator-loopback": "^6.0.0", + "inquirer": "~6.3.1", "minimist": "^1.2.0" }, "devDependencies": { - "chai": "^4.1.0", + "chai": "^4.1.2", "dirty-chai": "^2.0.1", - "eslint": "^4.3.0", - "eslint-config-loopback": "^8.0.0", + "eslint": "^5.6.0", + "eslint-config-loopback": "^12.0.0", "mkdirp": "^0.5.1", - "mocha": "^3.2.0", - "rimraf": "^2.6.1" + "mocha": "^5.2.0", + "rimraf": "^2.6.2" } } diff --git a/test/fixtures/help-lb-acl.txt b/test/fixtures/help-lb-acl.txt index 6304f55..59967ff 100644 --- a/test/fixtures/help-lb-acl.txt +++ b/test/fixtures/help-lb-acl.txt @@ -2,9 +2,10 @@ Usage: lb acl [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Description: Adds a new ACL entry to the LoopBack application. diff --git a/test/fixtures/help-lb-bluemix.txt b/test/fixtures/help-lb-bluemix.txt index f851c25..3ef108c 100644 --- a/test/fixtures/help-lb-bluemix.txt +++ b/test/fixtures/help-lb-bluemix.txt @@ -2,16 +2,17 @@ Usage: lb bluemix [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false - --appName # Application name - --docker # Generate Dockerfile - --manifest # Generate Bluemix manifest file - --toolchain # Set up Bluemix toolchain - --login # Log into Bluemix Default: false - --sso # Log into Bluemix with SSO - --provision # Provision a Bluemix service Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false + --appName # Application name + --docker # Generate Dockerfile + --manifest # Generate Bluemix manifest file + --toolchain # Set up Bluemix toolchain + --login # Log into Bluemix Default: false + --sso # Log into Bluemix with SSO + --provision # Provision a Bluemix service Default: false Description: `toolchain`, `manifest`, and `docker` are scaffold options. Not specifying any of them is interpreted as diff --git a/test/fixtures/help-lb-boot-script.txt b/test/fixtures/help-lb-boot-script.txt index 2586c7e..a20c545 100644 --- a/test/fixtures/help-lb-boot-script.txt +++ b/test/fixtures/help-lb-boot-script.txt @@ -2,9 +2,10 @@ Usage: lb boot-script [options] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Arguments: name # Name of the boot script to create. Type: String Required: false diff --git a/test/fixtures/help-lb-datasource.txt b/test/fixtures/help-lb-datasource.txt index 201b9b3..91782d4 100644 --- a/test/fixtures/help-lb-datasource.txt +++ b/test/fixtures/help-lb-datasource.txt @@ -2,12 +2,13 @@ Usage: lb datasource [options] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false - --bluemix # Add a datasource from Bluemix - --login # Log into Bluemix Default: false - --sso # Log into Bluemix with SSO + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false + --bluemix # Add a datasource from Bluemix + --login # Log into Bluemix Default: false + --sso # Log into Bluemix with SSO Arguments: name # Name of the datasource to create. Type: String Required: false diff --git a/test/fixtures/help-lb-export-api-def.txt b/test/fixtures/help-lb-export-api-def.txt index 70839f1..4a4e00e 100644 --- a/test/fixtures/help-lb-export-api-def.txt +++ b/test/fixtures/help-lb-export-api-def.txt @@ -2,10 +2,11 @@ Usage: lb export-api-def [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false - -o, --output # Name/Full path to the output file. + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false + -o, --output # Name/Full path to the output file. Description: Generate Swagger API definitions for LoopBack applications. diff --git a/test/fixtures/help-lb-middleware.txt b/test/fixtures/help-lb-middleware.txt index d5632b0..ec20305 100644 --- a/test/fixtures/help-lb-middleware.txt +++ b/test/fixtures/help-lb-middleware.txt @@ -2,9 +2,10 @@ Usage: lb middleware [options] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Arguments: name # Name of the middleware to create. Type: String Required: false diff --git a/test/fixtures/help-lb-model.txt b/test/fixtures/help-lb-model.txt index 4d59201..5cde92a 100644 --- a/test/fixtures/help-lb-model.txt +++ b/test/fixtures/help-lb-model.txt @@ -2,10 +2,11 @@ Usage: lb model [options] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false - --bluemix # Bind to a Bluemix datasource + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false + --bluemix # Bind to a Bluemix datasource Arguments: name # Name of the model to create. Type: String Required: false diff --git a/test/fixtures/help-lb-oracle.txt b/test/fixtures/help-lb-oracle.txt index d5f4d98..48fa3bb 100644 --- a/test/fixtures/help-lb-oracle.txt +++ b/test/fixtures/help-lb-oracle.txt @@ -2,12 +2,13 @@ Usage: lb oracle [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false - --connector # Install loopback-connector-oracle module - --driver # Install oracledb module - --verbose # Print verbose information + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false + --connector # Install loopback-connector-oracle module + --driver # Install oracledb module + --verbose # Print verbose information Description: Utility to help install LoopBack Oracle connector. diff --git a/test/fixtures/help-lb-property.txt b/test/fixtures/help-lb-property.txt index 7521208..3677631 100644 --- a/test/fixtures/help-lb-property.txt +++ b/test/fixtures/help-lb-property.txt @@ -2,9 +2,10 @@ Usage: lb property [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Description: Creates a new model property in the LoopBack application. diff --git a/test/fixtures/help-lb-relation.txt b/test/fixtures/help-lb-relation.txt index 3b9fd78..dea57c6 100644 --- a/test/fixtures/help-lb-relation.txt +++ b/test/fixtures/help-lb-relation.txt @@ -2,9 +2,10 @@ Usage: lb relation [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Description: Creates a new model relation in the LoopBack application. diff --git a/test/fixtures/help-lb-remote-method.txt b/test/fixtures/help-lb-remote-method.txt index a7a7bae..b449f40 100644 --- a/test/fixtures/help-lb-remote-method.txt +++ b/test/fixtures/help-lb-remote-method.txt @@ -2,9 +2,10 @@ Usage: lb remote-method [options] [] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Arguments: modelName # Name of the model Type: String Required: false diff --git a/test/fixtures/help-lb-soap.txt b/test/fixtures/help-lb-soap.txt index 0e4cf33..7db8540 100644 --- a/test/fixtures/help-lb-soap.txt +++ b/test/fixtures/help-lb-soap.txt @@ -2,9 +2,10 @@ Usage: lb soap [options] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Arguments: url # URL or file path of the WSDL Type: String Required: false diff --git a/test/fixtures/help-lb-swagger.txt b/test/fixtures/help-lb-swagger.txt index eec6b3f..a4bccee 100644 --- a/test/fixtures/help-lb-swagger.txt +++ b/test/fixtures/help-lb-swagger.txt @@ -2,9 +2,10 @@ Usage: lb swagger [options] [] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Arguments: url # URL of the swagger spec. Type: String Required: false diff --git a/test/fixtures/help-lb-zosconnectee.txt b/test/fixtures/help-lb-zosconnectee.txt index a7a48a0..1d2b617 100644 --- a/test/fixtures/help-lb-zosconnectee.txt +++ b/test/fixtures/help-lb-zosconnectee.txt @@ -2,9 +2,10 @@ Usage: lb zosconnectee [options] Options: - -h, --help # Print the generator's options and usage - --skip-cache # Do not remember prompt answers Default: false - --skip-install # Do not automatically install dependencies Default: false + -h, --help # Print the generator's options and usage + --skip-cache # Do not remember prompt answers Default: false + --skip-install # Do not automatically install dependencies Default: false + --force-install # Fail on install dependencies error Default: false Description: Configures a z/OS Connect EE DataSource. diff --git a/test/fixtures/help-lb.txt b/test/fixtures/help-lb.txt index 425d8d1..37ad104 100644 --- a/test/fixtures/help-lb.txt +++ b/test/fixtures/help-lb.txt @@ -5,12 +5,12 @@ Options: -h, --help # Print the command's options and usage --skip-cache # Do not remember prompt answers Default: false --skip-install # Do not install npm dependencies Default: false + --force-install # Fail on install dependencies error Default: false --skip-next-steps # Do not print "next steps" info --explorer # Add Loopback Explorer to the project (true by default) - --loopbackVersion # Select the LoopBack version --template # Set up the LoopBack application template --bluemix # Set up as a Bluemix app - --version # Display version information + --version # Display version information Default: false Arguments: name # Name of the application to scaffold. Type: String Required: false diff --git a/test/help.test.js b/test/help.test.js index 681b128..9a37d17 100644 --- a/test/help.test.js +++ b/test/help.test.js @@ -1,4 +1,4 @@ -// Copyright IBM Corp. 2016. All Rights Reserved. +// Copyright IBM Corp. 2016,2019. All Rights Reserved. // Node module: loopback-cli // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT @@ -54,7 +54,8 @@ describe('help', () => { const expected = fs.readFileSync( path.resolve(FIXTURES, helpFile), - 'utf-8'); + 'utf-8' + ); expect(actual).to.equal(expected); }); diff --git a/test/helpers/invoke.js b/test/helpers/invoke.js index 2c4ce77..7570fc8 100644 --- a/test/helpers/invoke.js +++ b/test/helpers/invoke.js @@ -1,4 +1,4 @@ -// Copyright IBM Corp. 2016. All Rights Reserved. +// Copyright IBM Corp. 2016,2019. All Rights Reserved. // Node module: loopback-cli // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT @@ -56,4 +56,4 @@ function invokeCli(args, prompts) { resolve({stdout, stderr, exitCode: code}); }); }); -}; +} diff --git a/test/helpers/responder.js b/test/helpers/responder.js index cd002b3..feb2d0b 100644 --- a/test/helpers/responder.js +++ b/test/helpers/responder.js @@ -1,4 +1,4 @@ -// Copyright IBM Corp. 2016. All Rights Reserved. +// Copyright IBM Corp. 2016,2019. All Rights Reserved. // Node module: loopback-cli // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT diff --git a/test/smoke.test.js b/test/smoke.test.js index aae889e..b8bc4a1 100644 --- a/test/smoke.test.js +++ b/test/smoke.test.js @@ -1,4 +1,4 @@ -// Copyright IBM Corp. 2016. All Rights Reserved. +// Copyright IBM Corp. 2016,2019. All Rights Reserved. // Node module: loopback-cli // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT @@ -117,7 +117,8 @@ describe('smoke tests - lb', () => { }) .then(() => { const modelJson = require(sandbox.resolve( - 'common/models/test-model.json')); + 'common/models/test-model.json' + )); expect(modelJson.name, 'model name in JSON').to.equal('test-model'); }); }); @@ -258,8 +259,7 @@ describe('smoke tests - lb', () => { }; return givenProjectInSandbox() - .then(() => invoke(['swagger'], prompts) - ).then(() => { + .then(() => invoke(['swagger'], prompts)).then(() => { const pets = require(sandbox.resolve('common/models/pets.json')); expect(pets.name).to.eql('pets'); expect(pets.base).to.eql('Model');