Skip to content

Commit

Permalink
add: TS tests
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Dec 8, 2024
1 parent 32993ba commit 085d393
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 4 deletions.
29 changes: 28 additions & 1 deletion package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@
"unist-util-visit": "^5.0.0",
"unist-util-visit-parents": "^6.0.1",
"yamljs": "^0.3.0",
"zotero-plugin-scaffold": "file:../zotero-plugin-scaffold",
"zotero-plugin-toolkit": "^4.0.11"
},
"devDependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@prettier/plugin-xml": "^3.2.2",
"@types/browser-or-node": "^1.3.2",
"@types/chai": "^5.0.1",
"@types/diff": "^5.0.9",
"@types/html-docx-js": "^0.3.4",
"@types/katex": "^0.16.7",
"@types/mocha": "^10.0.10",
"@types/node": "^20.10.4",
"@types/path-browserify": "^1.0.2",
"@types/seedrandom": "^3.0.8",
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"composite": true
},
"include": ["./**/*.spec.ts", "typings", "../node_modules/zotero-types"],
"exclude": []
}
6 changes: 6 additions & 0 deletions test/typings/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type * as chai from "chai";

declare global {
const expect: typeof chai.expect;
const assert: typeof chai.assert;
}
8 changes: 6 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"resolveJsonModule": true,
"skipLibCheck": true,
"alwaysStrict": false,
"strict": true
"strict": true,
"composite": true
},
"include": ["src", "typings", "node_modules/zotero-types"],
"exclude": ["build", "addon"]
"exclude": ["build", "addon", "test"],
"references": [
{ "path": "./test" }
]
}
3 changes: 2 additions & 1 deletion zotero-plugin.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default defineConfig({
entries: ["test/"],
prefs: {},
abortOnFail: true,
exitOnFinish: true,
exitOnFinish: false,
hooks: {},
},

// If you need to see a more detailed build log, uncomment the following line:
Expand Down

0 comments on commit 085d393

Please sign in to comment.