Skip to content

Commit

Permalink
feat: Add E2E testing
Browse files Browse the repository at this point in the history
  • Loading branch information
st3v3nmw committed May 13, 2023
1 parent 233d7fc commit 1ef0663
Show file tree
Hide file tree
Showing 18 changed files with 2,942 additions and 36 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -21,8 +21,9 @@ yarn-error.log
# build
build

# coverage
# testing
coverage
tests/e2e/vault/

# mkdocs
site/
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Expand Up @@ -5,3 +5,4 @@ node_modules
.pnp.cjs
.pnp.loader.mjs
pnpm-lock.yaml
tests/e2e/vault/
8 changes: 8 additions & 0 deletions Makefile
@@ -0,0 +1,8 @@
.PHONY: setup_e2e
setup_e2e:
rm -rf tests/e2e/vault
mkdir --parents tests/e2e/vault/.obsidian/plugins/obsidian-spaced-repetition/
pnpm build
cp build/main.js tests/e2e/vault/.obsidian/plugins/obsidian-spaced-repetition/
cp styles.css tests/e2e/vault/.obsidian/plugins/obsidian-spaced-repetition/
cp manifest.json tests/e2e/vault/.obsidian/plugins/obsidian-spaced-repetition/
2 changes: 1 addition & 1 deletion jest.config.js
Expand Up @@ -8,7 +8,7 @@ module.exports = {
"src/(.*)": "<rootDir>/src/$1",
},
moduleFileExtensions: ["js", "jsx", "ts", "tsx", "json", "node", "d.ts"],
roots: ["<rootDir>/src/", "<rootDir>/tests/"],
roots: ["<rootDir>/src/", "<rootDir>/tests/unit/"],
collectCoverageFrom: ["src/**/lang/*.ts", "src/parser.ts", "src/scheduling.ts", "utils.ts"],
coveragePathIgnorePatterns: [
"/node_modules/",
Expand Down
12 changes: 10 additions & 2 deletions package.json
Expand Up @@ -9,7 +9,8 @@
"format": "npx prettier --write .",
"lint": "npx prettier --check . && npx eslint src/",
"test": "jest",
"changelog": "auto-changelog --template=compact --package && npx prettier --write CHANGELOG.md"
"changelog": "auto-changelog --template=compact --package && npx prettier --write CHANGELOG.md",
"e2e": "make setup_e2e && wdio run ./wdio.conf.js"
},
"keywords": [
"obsidian",
Expand All @@ -24,8 +25,14 @@
"@types/vhtml": "^2.2.4",
"@typescript-eslint/eslint-plugin": "^5.59.5",
"@typescript-eslint/parser": "^5.59.5",
"@wdio/cli": "^8.10.2",
"@wdio/local-runner": "^8.10.2",
"@wdio/mocha-framework": "^8.10.2",
"@wdio/selenium-standalone-service": "^8.10.2",
"@wdio/spec-reporter": "^8.10.2",
"auto-changelog": "^2.4.0",
"builtin-modules": "^3.3.0",
"chai": "^4.3.7",
"esbuild": "~0.17.18",
"eslint": "^8.40.0",
"jest": "^29.5.0",
Expand All @@ -37,7 +44,8 @@
"ts-jest": "^29.1.0",
"tslib": "2.5.0",
"typescript": "5.0.4",
"vhtml": "^2.2.0"
"vhtml": "^2.2.0",
"wdio-chromedriver-service": "^8.1.1"
},
"dependencies": {
"chart.js": "^4.3.0",
Expand Down

0 comments on commit 1ef0663

Please sign in to comment.