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

Commit 9a6cdc5

Browse files
author
Simon Stone
authored
Merge pull request #16 from sstone1/master
Tests randomly fail as fighting over connection profile
2 parents 7bcad0f + b910d76 commit 9a6cdc5

File tree

13 files changed

+50
-25
lines changed

13 files changed

+50
-25
lines changed

packages/animaltracking-network/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"postlint": "npm run licchk",
1010
"licchk": "license-check",
1111
"postlicchk": "npm run doc",
12-
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf .",
12+
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
1313
"pkgstamp": "node ./scripts/pkgstamp.js"
1414
},
1515
"repository": {
@@ -26,6 +26,7 @@
2626
"movement"
2727
],
2828
"devDependencies": {
29+
"browserfs": "^1.2.0",
2930
"composer-cli": "latest",
3031
"eslint": "^3.6.1",
3132
"jsdoc": "^3.4.1",

packages/bond-network/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"postlint": "npm run licchk",
1010
"licchk": "license-check",
1111
"postlicchk": "npm run doc",
12-
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf .",
12+
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
1313
"test": "mocha --recursive",
1414
"deploy": "./scripts/deploy.sh"
1515
},
@@ -25,11 +25,12 @@
2525
"author": "Fabric Composer",
2626
"license": "Apache-2.0",
2727
"devDependencies": {
28+
"browserfs": "^1.2.0",
29+
"chai": "^3.5.0",
2830
"composer-admin": "latest",
2931
"composer-cli": "latest",
3032
"composer-client": "latest",
3133
"composer-connector-embedded": "latest",
32-
"chai": "^3.5.0",
3334
"eslint": "^3.6.1",
3435
"istanbul": "^0.4.5",
3536
"jsdoc": "^3.4.1",

packages/bond-network/test/Bond.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,23 @@
1515
'use strict';
1616

1717
const AdminConnection = require('composer-admin').AdminConnection;
18+
const BrowserFS = require('browserfs/dist/node/index');
1819
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
1920
const BusinessNetworkDefinition = require('composer-common').BusinessNetworkDefinition;
2021
const path = require('path');
2122

2223
require('chai').should();
2324

25+
const bfs_fs = BrowserFS.BFSRequire('fs');
2426
const NS = 'org.acme.bond';
2527

2628
describe('Publish Bond', () => {
2729

2830
let businessNetworkConnection;
2931

3032
before(() => {
31-
const adminConnection = new AdminConnection();
33+
BrowserFS.initialize(new BrowserFS.FileSystem.InMemory());
34+
const adminConnection = new AdminConnection({ fs: bfs_fs });
3235
return adminConnection.createProfile('defaultProfile', {
3336
type: 'embedded'
3437
})
@@ -42,7 +45,7 @@ describe('Publish Bond', () => {
4245
return adminConnection.deploy(businessNetworkDefinition);
4346
})
4447
.then(() => {
45-
businessNetworkConnection = new BusinessNetworkConnection();
48+
businessNetworkConnection = new BusinessNetworkConnection({ fs: bfs_fs });
4649
return businessNetworkConnection.connect('defaultProfile', 'bond-network', 'WebAppAdmin', 'DJY27pEnl16d');
4750
});
4851
});

packages/carauction-network/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"postlint": "npm run licchk",
1010
"licchk": "license-check",
1111
"postlicchk": "npm run doc",
12-
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf .",
12+
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
1313
"test": "mocha --recursive",
1414
"deploy": "./scripts/deploy.sh"
1515
},
@@ -24,11 +24,12 @@
2424
"author": "Fabric Composer",
2525
"license": "Apache-2.0",
2626
"devDependencies": {
27+
"browserfs": "^1.2.0",
28+
"chai": "^3.5.0",
2729
"composer-admin": "latest",
2830
"composer-cli": "latest",
2931
"composer-client": "latest",
3032
"composer-connector-embedded": "latest",
31-
"chai": "^3.5.0",
3233
"eslint": "^3.6.1",
3334
"istanbul": "^0.4.5",
3435
"jsdoc": "^3.4.1",

packages/carauction-network/test/CarAuction.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
'use strict';
1616

1717
const AdminConnection = require('composer-admin').AdminConnection;
18+
const BrowserFS = require('browserfs/dist/node/index');
1819
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
1920
const BusinessNetworkDefinition = require('composer-common').BusinessNetworkDefinition;
2021
const path = require('path');
2122

2223
require('chai').should();
2324

25+
const bfs_fs = BrowserFS.BFSRequire('fs');
2426
const NS = 'org.acme.vehicle.auction';
2527

2628
describe('CarAuction', () => {
@@ -29,7 +31,8 @@ describe('CarAuction', () => {
2931
let businessNetworkConnection;
3032

3133
before(() => {
32-
const adminConnection = new AdminConnection();
34+
BrowserFS.initialize(new BrowserFS.FileSystem.InMemory());
35+
const adminConnection = new AdminConnection({ fs: bfs_fs });
3336
return adminConnection.createProfile('defaultProfile', {
3437
type: 'embedded'
3538
})
@@ -43,7 +46,7 @@ describe('CarAuction', () => {
4346
return adminConnection.deploy(businessNetworkDefinition);
4447
})
4548
.then(() => {
46-
businessNetworkConnection = new BusinessNetworkConnection();
49+
businessNetworkConnection = new BusinessNetworkConnection({ fs: bfs_fs });
4750
return businessNetworkConnection.connect('defaultProfile', 'carauction-network', 'WebAppAdmin', 'DJY27pEnl16d');
4851
});
4952
});

packages/digitalproperty-network/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"postlint": "npm run licchk",
1010
"licchk": "license-check",
1111
"postlicchk": "npm run doc",
12-
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf .",
12+
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
1313
"test": "mocha --recursive",
1414
"deploy": "./scripts/deploy.sh"
1515
},
@@ -23,11 +23,12 @@
2323
"author": "Fabric Composer",
2424
"license": "Apache-2.0",
2525
"devDependencies": {
26+
"browserfs": "^1.2.0",
27+
"chai": "^3.5.0",
2628
"composer-admin": "latest",
2729
"composer-cli": "latest",
2830
"composer-client": "latest",
2931
"composer-connector-embedded": "latest",
30-
"chai": "^3.5.0",
3132
"eslint": "^3.6.1",
3233
"istanbul": "^0.4.5",
3334
"jsdoc": "^3.4.1",

packages/digitalproperty-network/test/DigitalLandTitle.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@
1515
'use strict';
1616

1717
const AdminConnection = require('composer-admin').AdminConnection;
18+
const BrowserFS = require('browserfs/dist/node/index');
1819
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
1920
const BusinessNetworkDefinition = require('composer-common').BusinessNetworkDefinition;
2021
const path = require('path');
2122

2223
require('chai').should();
2324

25+
const bfs_fs = BrowserFS.BFSRequire('fs');
2426
describe('DigitalLandTitle', () => {
2527

2628
let adminConnection;
2729
let businessNetworkConnection;
2830

2931
before(() => {
30-
adminConnection = new AdminConnection();
32+
BrowserFS.initialize(new BrowserFS.FileSystem.InMemory());
33+
const adminConnection = new AdminConnection({ fs: bfs_fs });
3134
return adminConnection.createProfile('testprofile', { type: 'embedded' })
3235
.then(() => {
3336
return adminConnection.connect('testprofile', 'WebAppAdmin', 'DJY27pEnl16d');
@@ -39,7 +42,7 @@ describe('DigitalLandTitle', () => {
3942
return adminConnection.deploy(businessNetworkDefinition);
4043
})
4144
.then(() => {
42-
businessNetworkConnection = new BusinessNetworkConnection();
45+
businessNetworkConnection = new BusinessNetworkConnection({ fs: bfs_fs });
4346
return businessNetworkConnection.connect('testprofile', 'digitalproperty-network', 'WebAppAdmin', 'DJY27pEnl16d');
4447
});
4548
});

packages/marbles-network/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"postlint": "npm run licchk",
1010
"licchk": "license-check",
1111
"postlicchk": "npm run doc",
12-
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf .",
12+
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
1313
"test": "mocha --recursive",
1414
"deploy": "./scripts/deploy.sh"
1515
},
@@ -25,11 +25,12 @@
2525
"author": "Fabric Composer",
2626
"license": "Apache-2.0",
2727
"devDependencies": {
28+
"browserfs": "^1.2.0",
29+
"chai": "^3.5.0",
2830
"composer-admin": "latest",
2931
"composer-cli": "latest",
3032
"composer-client": "latest",
3133
"composer-connector-embedded": "latest",
32-
"chai": "^3.5.0",
3334
"eslint": "^3.6.1",
3435
"istanbul": "^0.4.5",
3536
"jsdoc": "^3.4.1",

packages/marbles-network/test/MarblesTests.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
'use strict';
1616

1717
const AdminConnection = require('composer-admin').AdminConnection;
18+
const BrowserFS = require('browserfs/dist/node/index');
1819
const BusinessNetworkConnection = require('composer-client').BusinessNetworkConnection;
1920
const BusinessNetworkDefinition = require('composer-common').BusinessNetworkDefinition;
2021
const path = require('path');
2122

2223
require('chai').should();
2324

25+
const bfs_fs = BrowserFS.BFSRequire('fs');
2426
const NS = 'org.fabric_composer.marbles';
2527

2628
describe('Marbles', () => {
@@ -29,7 +31,8 @@ describe('Marbles', () => {
2931
let businessNetworkConnection;
3032

3133
before(() => {
32-
const adminConnection = new AdminConnection();
34+
BrowserFS.initialize(new BrowserFS.FileSystem.InMemory());
35+
const adminConnection = new AdminConnection({ fs: bfs_fs });
3336
return adminConnection.createProfile('defaultProfile', {
3437
type: 'embedded'
3538
})
@@ -43,7 +46,7 @@ describe('Marbles', () => {
4346
return adminConnection.deploy(businessNetworkDefinition);
4447
})
4548
.then(() => {
46-
businessNetworkConnection = new BusinessNetworkConnection();
49+
businessNetworkConnection = new BusinessNetworkConnection({ fs: bfs_fs });
4750
return businessNetworkConnection.connect('defaultProfile', 'marbles-network', 'WebAppAdmin', 'DJY27pEnl16d');
4851
});
4952
});

packages/perishable-network/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"postlint": "npm run licchk",
1010
"licchk": "license-check",
1111
"postlicchk": "npm run doc",
12-
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf .",
12+
"doc": "jsdoc --pedantic --recurse -c jsdoc.conf",
1313
"test": "mocha --recursive",
1414
"deploy": "./scripts/deploy.sh"
1515
},
@@ -26,11 +26,12 @@
2626
"author": "Fabric Composer",
2727
"license": "Apache-2.0",
2828
"devDependencies": {
29+
"browserfs": "^1.2.0",
30+
"chai": "^3.5.0",
2931
"composer-admin": "latest",
3032
"composer-cli": "latest",
3133
"composer-client": "latest",
3234
"composer-connector-embedded": "latest",
33-
"chai": "^3.5.0",
3435
"eslint": "^3.6.1",
3536
"istanbul": "^0.4.5",
3637
"jsdoc": "^3.4.1",

0 commit comments

Comments
 (0)