Skip to content

Commit 2664f5d

Browse files
authored
Merge pull request #669 from marp-team/upgrade-jest
Upgrade Jest to v30
2 parents dd507b1 + 9df8ea9 commit 2664f5d

File tree

7 files changed

+1407
-1063
lines changed

7 files changed

+1407
-1063
lines changed

.circleci/config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ commands:
3030
sudo apt-get update
3131
sudo apt-get install -y libreoffice-common libreoffice-java-common libreoffice-impress default-jre
3232
33+
- run:
34+
name: Hash patches
35+
command: md5sum patches/* > ~/.patches.hash
36+
3337
- restore_cache:
3438
keys:
35-
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ .Branch }}
39+
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ checksum "~/.patches.hash" }}-{{ .Branch }}
40+
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ checksum "~/.patches.hash" }}-
3641
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-
3742
- v3-dependencies-{{ .Environment.CIRCLE_JOB }}-
3843

@@ -43,7 +48,7 @@ commands:
4348
- steps: << parameters.postinstall >>
4449

4550
- save_cache:
46-
key: v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ .Branch }}
51+
key: v3-dependencies-{{ .Environment.CIRCLE_JOB }}-{{ checksum "package-lock.json" }}-{{ checksum "~/.patches.hash" }}-{{ .Branch }}
4752
paths:
4853
- ~/.npm
4954

.github/CONTRIBUTING.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,31 @@ We are following [**the contributing guideline of Marp team projects**][team-con
88

99
## Table of contents
1010

11-
- [Marp team contributing guideline][team-contributing-guideline]
11+
- [Marp team contributing guideline ↗️][team-contributing-guideline]
1212
- [Development](#development)
13+
- [Installation](#installation)
14+
- [Build and watch](#build-and-watch)
15+
- [Use built version](#use-built-version)
16+
- [Testing](#testing)
1317
- [Debug](#debug)
1418

1519
## Development
1620

21+
### Installation
22+
23+
```bash
24+
npm install
25+
npx patch-package
26+
```
27+
28+
Running [`npx patch-package`](https://github.com/ds300/patch-package) after `npm install` is required to apply patches for development dependencies. See also [the documentation of patches](../patches/README.md) for details.
29+
30+
> [!NOTE]
31+
>
32+
> `patch-package` recommends to [add `postinstall` script to `package.json` to run it automatically after `npm install`](https://github.com/ds300/patch-package?tab=readme-ov-file#set-up). However, Marp CLI does not use it because it will run also when installing CLI by users.
33+
34+
### Build and watch
35+
1736
```bash
1837
# Build (Bundle and minify)
1938
npm run build
@@ -30,7 +49,7 @@ Use `./marp-cli.js` instead of `marp` command.
3049
./marp-cli.js --help
3150
```
3251

33-
### Standalone binary
52+
#### Standalone binary
3453

3554
Standalone binaries created by [pkg](https://github.com/zeit/pkg) will output to `./bin` directory.
3655

@@ -43,6 +62,21 @@ npm run build:standalone
4362
./bin/marp-cli-linux --help
4463
```
4564

65+
### Testing
66+
67+
```bash
68+
# Run all tests
69+
npm run test
70+
71+
# Run tests with code coverage
72+
npm run test:coverage
73+
74+
# Run test for specific file(s)
75+
npm run test -- ./test/marp-cli.ts
76+
```
77+
78+
You need to install [Google Chrome](https://www.google.com/chrome/), [Mozilla Firefox](https://www.mozilla.org/firefox/), and [LibreOffice](https://www.libreoffice.org/download/download-libreoffice/) for running all tests.
79+
4680
## Debug
4781

4882
If you have any trouble with Marp CLI, `--debug` (`-d`) option will help you to find the cause of the problem.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Changed
66

77
- Server mode: Connect to proxied watch notifier WebSocket server instead of `localhost` ([#513](https://github.com/marp-team/marp-cli/issues/513), [#664](https://github.com/marp-team/marp-cli/pull/664))
8+
- Upgrade Jest to v30 ([#669](https://github.com/marp-team/marp-cli/pull/669))
89

910
### Fixed
1011

0 commit comments

Comments
 (0)