Skip to content

Commit da9de52

Browse files
author
gabe
committed
get impls as json
1 parent 453f52f commit da9de52

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

implementations/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import fs from 'fs';
2+
import path from 'path';
3+
4+
const jsonsInDir = fs.readdirSync('./').filter(file => path.extname(file) === '.json');
5+
6+
const implementations = jsonsInDir.map(file => {
7+
const fileData = fs.readFileSync(path.join('./', file));
8+
return JSON.parse(fileData.toString());
9+
});

implementations/sample.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "test impl",
3+
"specs": {
4+
"2020-12": [
5+
"JsonSchema",
6+
"JsonSchemaCredential"
7+
],
8+
"2019-09": [
9+
"JsonSchema",
10+
"JsonSchemaCredential"
11+
],
12+
"Draft-7": [
13+
"JsonSchema",
14+
"JsonSchemaCredential"
15+
]
16+
}
17+
}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
},
1111
"main": "/tests",
1212
"type": "module",
13-
"directories": {
14-
"tests": "tests"
15-
},
13+
"files": [
14+
"implementations/*.js",
15+
"tests/*.js"
16+
],
1617
"scripts": {
1718
"test": "mocha tests/ --reporter @digitalbazaar/mocha-w3c-interop-reporter --reporter-options abstract=\"$PWD/abstract.hbs\",reportDir=\"$PWD/reports\",respec=\"$PWD/respecConfig.json\",title=\"VC JSON Schema Test Suite\",suiteLog='./suite.log' --timeout 15000 --preserve-symlinks",
1819
"lint": "eslint ."

0 commit comments

Comments
 (0)