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

Packages updated. Configs changed to use ESM #1715

Merged
merged 7 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:

- name: running test with codecov
run: REDIS=redis://127.0.0.1:6379 ZIMCHECK_PATH=`find .. -name zimcheck` npm run codecov
env:
S3_URL: ${{ secrets.S3_URL }}

- name: running test
run: npm run jest
Expand Down
24 changes: 14 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm ci

To run it (this is only an example):
```bash
./node_modules/.bin/ts-node ./src/cli.ts --mwUrl=https://bm.wikipedia.org --adminEmail=XXX
./node_modules/.bin/ts-node-esm ./src/cli.ts --mwUrl=https://bm.wikipedia.org --adminEmail=XXX
```

or
Expand Down Expand Up @@ -77,24 +77,28 @@ npm run test:e2e

To run a specfic test with collecting coverage:
```bash
npm run test:pattern-coverage test/e2e/localParsoid.test.ts
npm run test:pattern test/e2e/wikisource.e2e.test.ts -- --coverage
```

To run a specfic test with collecting coverage:
To run a specfic test without collecting coverage:
```bash
npm run test:pattern test/e2e/localParsoid.test.ts
npm run test:pattern test/e2e/wikisource.e2e.test.ts
```

To run a tests by regex pattern. Example which runs all e2e tests:
```bash
npm run test:pattern ^.*e2e.*\.test\.ts
```

For S3 tests to pass, create a '.env' file (at the root of your
MWoffliner code directory) where you will configure the following
keys:
MWoffliner code directory) where you will configure S3 URL
with credentials. Example:
```
BASE_URL_TEST=...
KEY_ID_TEST=...
BUCKET_NAME_TEST=...
SECRET_ACCESS_KEY_TEST=...
S3_URL=https://s3.region.amazonaws.com/?bucketName=S3_BUCKET_NAME&keyId=S3_KEY_ID&secretAccessKey=S3_ACCESS_KEY
```

... or just ensure the `S3_URL` environment variable is properly set.

## Debugging

There is a pre-configured debug config for
Expand Down
18 changes: 18 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
moduleFileExtensions: ["ts", "js"],
collectCoverage: false,
verbose: true,
transform: {
'^.+\\.ts?$': [
'ts-jest',
{
useESM: true,
},
],
},
}

18 changes: 0 additions & 18 deletions jest.config.js

This file was deleted.

Loading