Skip to content

Commit 8af0011

Browse files
authored
Feature/445 Unit Tests for central-settlement (#23)
* Initialize test/ * Dummy .test.js files
1 parent f40aff8 commit 8af0011

37 files changed

Lines changed: 575 additions & 2319 deletions

‎package.json‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@
4040
},
4141
"scripts": {
4242
"start": "node src/server.js",
43-
"test": "tape 'tests/unit/**/*.js'",
44-
"test:xunit": "tape 'tests/unit/**/*.js' | tap-xunit",
45-
"cover": "istanbul cover tape -- 'tests/unit/**/*.js'",
43+
"test": "npm run test:unit | faucet",
44+
"test:unit": "tape 'test/unit/**/*.js'",
45+
"test:xunit": "tape 'test/unit/**/*.js' | tap-xunit",
46+
"cover": "istanbul cover tape -- 'test/unit/**/*.js'",
4647
"lint": "eslint .",
4748
"test:coverage-check": "npm run test:coverage && istanbul check-coverage",
48-
"test:coverage": "istanbul cover tape -- 'tests/unit/**/*.js'",
49-
"regenerate": "yo swaggerize:test --framework hapi --apiPath './interface/swagger.json'"
49+
"test:coverage": "istanbul cover tape -- 'test/unit/**/*.js'",
50+
"regenerate": "yo swaggerize:test --framework hapi --apiPath './src/interface/swagger.json'"
5051
},
5152
"generator-swaggerize": {
5253
"version": "4.1.0"
Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
--------------
44
Copyright © 2017 Bill & Melinda Gates Foundation
55
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6-
76
http://www.apache.org/licenses/LICENSE-2.0
8-
97
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
10-
118
Contributors
129
--------------
1310
This is the official list of the Mojaloop project contributors for this file.
@@ -18,28 +15,13 @@
1815
Gates Foundation organization for an example). Those individuals should have
1916
their names indented and be marked with a '-'. Email address can be added
2017
optionally within square brackets <email>.
21-
2218
* Gates Foundation
2319
- Name Surname <name.surname@gatesfoundation.com>
2420
25-
* Valentin Genev <valentin.genev@modusbox.com>
26-
* Deon Botha <deon.botha@modusbox.com>
27-
* Rajiv Mothilal <rajiv.mothilal@modusbox.com>
28-
* Miguel de Barros <miguel.debarros@modusbox.com>
29-
3021
--------------
3122
******/
3223

3324
'use strict'
34-
var Swagmock = require('swagmock')
35-
var Path = require('path')
36-
var apiPath = Path.resolve(__dirname, '../interface/swagger.json')
37-
var mockgen
3825

39-
module.exports = function () {
40-
/**
41-
* Cached mock generator
42-
*/
43-
mockgen = mockgen || Swagmock(apiPath)
44-
return mockgen
45-
}
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')

‎test/unit/models/index.test.js‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*****
2+
License
3+
--------------
4+
Copyright © 2017 Bill & Melinda Gates Foundation
5+
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
8+
Contributors
9+
--------------
10+
This is the official list of the Mojaloop project contributors for this file.
11+
Names of the original copyright holders (individuals or organizations)
12+
should be listed with a '*' in the first column. People who have
13+
contributed from an organization can be listed under the organization
14+
that actually holds the copyright for their contributions (see the
15+
Gates Foundation organization for an example). Those individuals should have
16+
their names indented and be marked with a '-'. Email address can be added
17+
optionally within square brackets <email>.
18+
* Gates Foundation
19+
- Name Surname <name.surname@gatesfoundation.com>
20+
21+
--------------
22+
******/
23+
24+
'use strict'
25+
26+
// const Test = require('tapes')(require('tape'))
27+
// const Sinon = require('sinon')

0 commit comments

Comments
 (0)