Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Add engines stanza to generated business network package.json (#3932)
Browse files Browse the repository at this point in the history
Also add _composer_ and _composer-network_ keywords.

Signed-off-by: Mark S. Lewis <[email protected]>
  • Loading branch information
bestbeforetoday authored and nklincoln committed May 1, 2018
1 parent 9b9aa54 commit 66a1773
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"engines": {
"composer": "<%= composerversion %>"
},
"name": "<%= appname %>",
"version": "0.0.1",
"description": "<%= appdescription %>",
Expand All @@ -8,6 +11,10 @@
"lint": "eslint .",
"test": "nyc mocha -t 0 test/*.js && cucumber-js"
},
"keywords": [
"composer",
"composer-network"
],
"author": "<%= appauthor %>",
"email": "<%= appemail %>",
"license": "<%= applicense %>",
Expand Down
20 changes: 7 additions & 13 deletions packages/generator-hyperledger-composer/test/business-network.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,26 +132,20 @@ describe('hyperledger-composer:businessnetwork', function () {
assert(fs.existsSync(packageFile), 'No package.json file detected in test run');

let myPackage = require(packageFile);
assert(myPackage.name === passedBusNetName, 'incorrect name in package file');
assert(myPackage.author === passedAuthor, 'incorrect author in package file');
assert(myPackage.email === passedEmail, 'incorrect email in package file');
assert(myPackage.license === passedLic, 'incorrect license in package file');
assert.strictEqual(myPackage.name, passedBusNetName, 'incorrect name in package file');
assert.strictEqual(myPackage.author, passedAuthor, 'incorrect author in package file');
assert.strictEqual(myPackage.email, passedEmail, 'incorrect email in package file');
assert.strictEqual(myPackage.license, passedLic, 'incorrect license in package file');
assert.strictEqual(myPackage.dependencies, undefined, 'there should be no production dependencies in package file');
assert.deepStrictEqual(myPackage.devDependencies, {
chai: 'latest',
'chai-as-promised': 'latest',
assert.objectContent(myPackage.devDependencies, {
'composer-admin': `^${version}`,
'composer-cli': `^${version}`,
'composer-client': `^${version}`,
'composer-common': `^${version}`,
'composer-connector-embedded': `^${version}`,
'composer-cucumber-steps': `^${version}`,
cucumber: '^2.2.0',
eslint: 'latest',
mkdirp: 'latest',
mocha: 'latest',
nyc: 'latest'
}, 'incorrect development dependencies in package file');
});
assert.objectContent(myPackage.engines, { composer: `^${version}`});
});
});

Expand Down

0 comments on commit 66a1773

Please sign in to comment.