Skip to content

Commit a2b9145

Browse files
committed
(#9) fixed image imports in unit tests
1 parent 3262074 commit a2b9145

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

.github/workflows/cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
shell: bash
2121
- run: npm install
2222
- run: npx lerna run build
23-
- run: npx lerna run test
23+
- run: npm t -- --runInBand --ci --bail
2424
- name: execute E2E tests
2525
run: |
2626
cd ./packages/e2e

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
node-version: 14.x
2121
- run: npm install
2222
- run: npx lerna run build
23-
- run: npx lerna run test
23+
- run: npm t -- --runInBand --ci --bail
2424
e2e-test:
2525
name: e2e-test
2626
runs-on: ubuntu-latest

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
run: echo "SAKULI_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
2424
- run: npm install
2525
- run: npx lerna run build
26-
- run: npx lerna run test
26+
- run: npm t -- --runInBand --ci --bail
2727
- name: execute E2E tests
2828
run: |
2929
cd ./packages/e2e

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
.idea
33
out
44
dist
5-
tsconfig.tsbuildinfo
5+
tsconfig.tsbuildinfo
6+
coverage

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"rebuild": "npm run clean && npm install && npm run build",
77
"clean": "lerna clean -y",
88
"postinstall": "lerna bootstrap",
9+
"test": "jest",
910
"build": "lerna run build",
1011
"lerna:publish": "lerna publish from-package --yes ",
1112
"lerna:publish-next": "lerna publish --canary --include-merged-tags --preid next --dist-tag next --pre-dist-tag next --no-push --no-git-tag-version --no-git-reset --force-publish --yes"

packages/sakuli-ocr/src/functions/postprocessScreenshot.spec.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,16 @@ const md5File = require("md5-file");
77
describe("postprocess screenshot", () => {
88
it("should modify screenshot to match snapshot image", async () => {
99
//GIVEN
10-
const originalScreenshot = join(
11-
process.cwd(),
12-
"src/functions/__mocks__/sakuli-screen.png"
13-
);
10+
const originalScreenshot = join(__dirname, "/__mocks__/sakuli-screen.png");
1411
const screenshotToModify = join(
15-
process.cwd(),
16-
"src/functions/__mocks__/sakuli-screen-modify.png"
12+
__dirname,
13+
"/__mocks__/sakuli-screen-modify.png"
1714
);
1815
await fs.copyFileSync(originalScreenshot, screenshotToModify);
1916

2017
const expectedResult = join(
21-
process.cwd(),
22-
"src/functions/__mocks__/sakuli-screen-snapshot.png"
18+
__dirname,
19+
"/__mocks__/sakuli-screen-snapshot.png"
2320
);
2421

2522
//WHEN

0 commit comments

Comments
 (0)