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

Commit 66a1773

Browse files
bestbeforetodaynklincoln
authored andcommitted
Add engines stanza to generated business network package.json (#3932)
Also add _composer_ and _composer-network_ keywords. Signed-off-by: Mark S. Lewis <[email protected]>
1 parent 9b9aa54 commit 66a1773

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

packages/generator-hyperledger-composer/generators/businessnetwork/templates/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"engines": {
3+
"composer": "<%= composerversion %>"
4+
},
25
"name": "<%= appname %>",
36
"version": "0.0.1",
47
"description": "<%= appdescription %>",
@@ -8,6 +11,10 @@
811
"lint": "eslint .",
912
"test": "nyc mocha -t 0 test/*.js && cucumber-js"
1013
},
14+
"keywords": [
15+
"composer",
16+
"composer-network"
17+
],
1118
"author": "<%= appauthor %>",
1219
"email": "<%= appemail %>",
1320
"license": "<%= applicense %>",

packages/generator-hyperledger-composer/test/business-network.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,26 +132,20 @@ describe('hyperledger-composer:businessnetwork', function () {
132132
assert(fs.existsSync(packageFile), 'No package.json file detected in test run');
133133

134134
let myPackage = require(packageFile);
135-
assert(myPackage.name === passedBusNetName, 'incorrect name in package file');
136-
assert(myPackage.author === passedAuthor, 'incorrect author in package file');
137-
assert(myPackage.email === passedEmail, 'incorrect email in package file');
138-
assert(myPackage.license === passedLic, 'incorrect license in package file');
135+
assert.strictEqual(myPackage.name, passedBusNetName, 'incorrect name in package file');
136+
assert.strictEqual(myPackage.author, passedAuthor, 'incorrect author in package file');
137+
assert.strictEqual(myPackage.email, passedEmail, 'incorrect email in package file');
138+
assert.strictEqual(myPackage.license, passedLic, 'incorrect license in package file');
139139
assert.strictEqual(myPackage.dependencies, undefined, 'there should be no production dependencies in package file');
140-
assert.deepStrictEqual(myPackage.devDependencies, {
141-
chai: 'latest',
142-
'chai-as-promised': 'latest',
140+
assert.objectContent(myPackage.devDependencies, {
143141
'composer-admin': `^${version}`,
144142
'composer-cli': `^${version}`,
145143
'composer-client': `^${version}`,
146144
'composer-common': `^${version}`,
147145
'composer-connector-embedded': `^${version}`,
148146
'composer-cucumber-steps': `^${version}`,
149-
cucumber: '^2.2.0',
150-
eslint: 'latest',
151-
mkdirp: 'latest',
152-
mocha: 'latest',
153-
nyc: 'latest'
154-
}, 'incorrect development dependencies in package file');
147+
});
148+
assert.objectContent(myPackage.engines, { composer: `^${version}`});
155149
});
156150
});
157151

0 commit comments

Comments
 (0)