Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for CKAN + various improvements #191

Merged
merged 7 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/four-rabbits-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@zazuko/trifid-plugin-ckan": patch
---

Generated XML documents have a blank line at the end.

This Trifid plugin will be more robust, as we created a set of tests.
8 changes: 8 additions & 0 deletions .changeset/honest-cows-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"trifid-core": minor
---

Improve types in general.

`trifid.start` now returns a `Promise<import('http').Server>` instead of `void`.
This allows to wait for the server to be ready before doing anything else.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"ignorePatterns": ["**/*.ts", "**/*.d.ts", "**/*.d.ts.map"],
"rules": {
"space-before-function-paren": "off"
"space-before-function-paren": "off",
"indent": ["error", 2, { "SwitchCase": 1 }]
}
}
212 changes: 212 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion packages/ckan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "src/index.js",
"type": "module",
"scripts": {
"test": "true"
ludovicm67 marked this conversation as resolved.
Show resolved Hide resolved
"test": "c8 --reporter=lcov --reporter=text mocha"
ludovicm67 marked this conversation as resolved.
Show resolved Hide resolved
},
"repository": {
"type": "git",
Expand All @@ -25,5 +25,10 @@
"dotenv": "^16.3.1",
"sparql-http-client": "^2.4.2",
"xmlbuilder2": "^3.1.1"
},
"devDependencies": {
"c8": "^8.0.1",
"mocha": "^10.2.0",
"oxigraph": "^0.3.20"
}
}
2 changes: 1 addition & 1 deletion packages/ckan/src/xml.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function toXML (dataset) {
}).filter(Boolean),
},
},
}).doc().end({ prettyPrint: true })
}).doc().end({ prettyPrint: true }).concat('\n')
}

function serializeTerm (pointer) {
Expand Down
Loading