-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtest.js
82 lines (81 loc) · 2.72 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
var ipfs = require('./test/ipfs-test/ipfs-test');
var fabric = require('./test/fabric-test/fabric-test');
var crypto = require('./test/crypto/key-test');
var airmed = require('./test/airmed-test/airmed-test');
var explorer = require('./test/airmed-test/blockchain-explorer/blockchain-explorer');
var secureRecUser = require('./test/secure-rec-test/user');
// IPFS TEST
describe('InterPlanetary Filesystem API TEST', function() {
ipfs.testDownloadAsync();
ipfs.testDownloadCallback();
ipfs.testUploadFromBuffer();
ipfs.testUploadFromPath();
});
// Hyperledger Test
describe('Hyperledger Fabric API TEST', function(){
this.timeout(60000);
fabric.invoqueTransaction();
fabric.queryChaincode();
});
// Crypto key test (Ursa Library)
describe('Crypto Library test', function(){
crypto.generateKeyTest();
crypto.getPublicKeyTest();
crypto.isPublicKeyTest();
crypto.isPrivateKeyTest();
crypto.encryptHashTest();
crypto.decryptHashTest();
crypto.assertPublicKeyTest();
crypto.assertPrivateKeyTest();
});
// Airmed Test
describe('Airmed Foundation Test', function(){
this.timeout(20000);
airmed.uploadFileTest();
airmed.uploadEncryptedFileTest();
airmed.downloadFileTest();
airmed.downloadEncryptedFileTest();
airmed.getIdentityTest();
airmed.recoveryIdentityTest();
airmed.getFilesTest();
});
// Explorer test
describe("Airmed Foundation Blockchain Explorer Test", function(){
describe("Blockchain Explorer http API", function(){
explorer.createBlock();
explorer.createTransaction();
explorer.createKeyIn();
explorer.createKeyOut();
explorer.getTotalBlocks();
explorer.getBlockByNumber();
});
});
// SECURE REC USER TEST
describe('SECURE REC USER TEST', function() {
this.timeout(200000);
secureRecUser.newUserPatient();
secureRecUser.newUserDoctor();
secureRecUser.newUserInsurance();
secureRecUser.newUserProviderClinic();
secureRecUser.newUserProviderPharmacy();
secureRecUser.newUserProviderLaboratory();
secureRecUser.login();
secureRecUser.logout();
secureRecUser.profile();
secureRecUser.changePassword();
secureRecUser.passwordRecovery();
secureRecUser.newAuthPatientDoctor();
secureRecUser.newAuthPatientInsurance();
secureRecUser.newAuthPatientProvider();
secureRecUser.uploadFile();
secureRecUser.downloadFile();
// Prescription test
secureRecUser.createPrescription();
secureRecUser.updatePrescription();
secureRecUser.consumePrescription();
secureRecUser.deletePrescription();
secureRecUser.downloadPrescription();
// Delete Authorization (Secure-rec)
secureRecUser.deleteAuth();
});