Skip to content

Commit d2056c3

Browse files
Adding tests to check for duplicates by name
1 parent b97e5db commit d2056c3

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

package-lock.json

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "turtlecoin-nodes-json",
3+
"version": "0.0.1",
4+
"description": "json list of public daemons",
5+
"main": "turtlecoin-nodes.json",
6+
"directories": {
7+
"test": "tests"
8+
},
9+
"scripts": {
10+
"test": "node tests/checkForDuplicates.js"
11+
},
12+
"repository": {
13+
"type": "git",
14+
"url": "git+https://github.com/turtlecoin/turtlecoin-nodes-json.git"
15+
},
16+
"keywords": [
17+
"turtlecoin",
18+
"public",
19+
"nodes"
20+
],
21+
"author": "The TurtleCoin Developers",
22+
"license": "AGPL-3.0",
23+
"bugs": {
24+
"url": "https://github.com/turtlecoin/turtlecoin-nodes-json/issues"
25+
},
26+
"homepage": "https://github.com/turtlecoin/turtlecoin-nodes-json#readme"
27+
}

tests/checkForDuplicates.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict'
2+
3+
const assert = require('assert')
4+
const data = require('../turtlecoin-nodes.json')
5+
6+
var seenNodes = []
7+
8+
for (var i = 0; i < data.nodes.length; i++) {
9+
var node = data.nodes[i]
10+
console.log(node.name)
11+
assert(seenNodes.indexOf(node.name) === -1)
12+
seenNodes.push(node.name)
13+
}

0 commit comments

Comments
 (0)