Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 01d8522

Browse filesBrowse files
committed
chore: use mocha for testing and eslint with double quotes rule
1 parent ca90403 commit 01d8522
Copy full SHA for 01d8522

File tree

Expand file treeCollapse file tree

10 files changed

+1206
-3280
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

10 files changed

+1206
-3280
lines changed
Open diff view settings
Collapse file

‎.eslintrc‎

Copy file name to clipboard
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
2-
"extends": "nelson",
2+
"extends": [
3+
"standard"
4+
],
35
"env": {
4-
"jest": true
6+
"mocha": true
7+
},
8+
"rules": {
9+
"indent": "off",
10+
"quotes": ["error", "double"]
511
}
612
}
Collapse file

‎.gitignore‎

Copy file name to clipboardExpand all lines: .gitignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
gitignore
2+
.vscode
23

34
# Logs
45
logs
Collapse file

‎package.json‎

Copy file name to clipboardExpand all lines: package.json
+16-11Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
"contributors": [
88
"Viliam Simko <viliam.simko@gmail.com> (https://github.com/vsimko)"
99
],
10-
"main": "src/index.js",
10+
"main": "src/index",
1111
"scripts": {
12-
"test": "jest",
12+
"test": "mocha",
1313
"lint": "eslint .",
14+
"release": "standard-version",
1415
"up": "cd test && docker-compose up -d",
1516
"down": "cd test && docker-compose down",
16-
"ps": "cd test && docker-compose ps"
17+
"ps": "cd test && docker-compose ps",
18+
"git-cred": "git config credential.helper store"
1719
},
1820
"repository": {
1921
"type": "git",
@@ -29,13 +31,16 @@
2931
"ramda": "^0.25.0"
3032
},
3133
"devDependencies": {
32-
"eslint": "^3.13.1",
33-
"eslint-config-nelson": "^0.2.0",
34-
"eslint-plugin-import": "^2.2.0",
35-
"jest": "23.0.0",
36-
"jest-cli": "23.0.0"
37-
},
38-
"jest": {
39-
"testEnvironment": "node"
34+
"@types/chai": "^4.1.4",
35+
"@types/mocha": "^5.2.3",
36+
"chai": "^4.1.2",
37+
"eslint": "^4.19.1",
38+
"eslint-config-standard": "^11.0.0",
39+
"eslint-plugin-import": "^2.12.0",
40+
"eslint-plugin-node": "^6.0.1",
41+
"eslint-plugin-promise": "^3.8.0",
42+
"eslint-plugin-standard": "^3.1.0",
43+
"mocha": "^5.2.0",
44+
"standard-version": "^4.4.0"
4045
}
4146
}
Collapse file

‎src/index.js‎

Copy file name to clipboard
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
const { compose, merge } = require('ramda');
2-
const { SPARQL } = require('./sparql');
1+
const { compose, merge } = require("ramda")
2+
const { SPARQL } = require("./sparql")
33
const {
44
deleteSparql,
55
querySparql,
66
updateSparql,
77
...otherFun
8-
} = require('./middleware');
8+
} = require("./middleware")
99

1010
const defaultOptions = {
11-
host: 'localhost',
11+
host: "localhost",
1212
port: 9999,
13-
namespace: 'kb',
14-
blazename: 'bigdata', // it was 'blazegraph' before
15-
};
13+
namespace: "kb",
14+
blazename: "bigdata" // it was 'blazegraph' before
15+
}
1616

1717
const prepareBlazeUrl = compose(
1818
({ host, port, namespace, blazename }) =>
1919
`http://${host}:${port}/${blazename}/namespace/${namespace}/sparql`,
2020
merge(defaultOptions),
2121
merge({})
22-
);
22+
)
2323

2424
// helper function that wraps other functons as template literals
25-
const tmpl = fn => (str, ...vars) => fn(SPARQL(str, ...vars));
25+
const tmpl = fn => (str, ...vars) => fn(SPARQL(str, ...vars))
2626

2727
module.exports = {
2828
prepareBlazeUrl,
2929
SELECT: tmpl(querySparql),
3030
UPDATE: tmpl(updateSparql),
3131
DELETE: tmpl(deleteSparql),
32-
...otherFun,
33-
};
32+
...otherFun
33+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.