Skip to content

Commit 962443d

Browse files
Migrate from Jest to Vitest (#921)
1 parent b31edb8 commit 962443d

File tree

252 files changed

+2367
-4060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+2367
-4060
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"customizations": {
1616
"vscode": {
17-
"extensions": ["Orta.vscode-jest", "esbenp.prettier-vscode"],
17+
"extensions": ["esbenp.prettier-vscode"],
1818
"settings": {
1919
"editor.formatOnSave": true,
2020
"editor.defaultFormatter": "esbenp.prettier-vscode"

.github/workflows/test-template.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ jobs:
7070
run: |
7171
brew install docker docker-compose
7272
brew install --cask rancher
73-
73+
7474
TIMEOUT_SECS_CLI_TOOLS=60
7575
TIMEOUT_SECS_USER_SOCKET=300
76-
76+
7777
echo "Open Rancher Desktop app"
7878
open "/Applications/Rancher Desktop.app"
79-
79+
8080
echo "Wait max of ${TIMEOUT_SECS_CLI_TOOLS}s for Rancher Desktop to create CLI tools"
8181
for i in $(seq 1 ${TIMEOUT_SECS_CLI_TOOLS}); do
8282
if [ -e "$HOME/.rd/bin/rdctl" ]; then
@@ -85,12 +85,12 @@ jobs:
8585
fi
8686
sleep 1
8787
done
88-
88+
8989
if [ ! -e "$HOME/.rd/bin/rdctl" ]; then
9090
echo "Rancher Desktop CLI tools not found"
9191
exit 1
9292
fi
93-
93+
9494
echo "Rancher Desktop initialised successfully, now configure the container runtime"
9595
$HOME/.rd/bin/rdctl set \
9696
--container-engine.name=moby \
@@ -101,28 +101,28 @@ jobs:
101101
--virtual-machine.number-cpus=3 \
102102
--virtual-machine.memory-in-gb=14 \
103103
|| true
104-
104+
105105
echo "Restart Rancher Desktop"
106106
$HOME/.rd/bin/rdctl shutdown
107107
$HOME/.rd/bin/rdctl start
108-
108+
109109
echo "Wait max of ${TIMEOUT_SECS_USER_SOCKET}s for Rancher socket"
110-
110+
111111
for i in $(seq 1 ${TIMEOUT_SECS_USER_SOCKET}); do
112112
if [ -e "$HOME/.rd/docker.sock" ]; then
113113
echo "Rancher Desktop socket created after ${i}s"
114114
break
115115
fi
116116
sleep 1
117117
done
118-
118+
119119
if [ ! -e "$HOME/.rd/docker.sock" ]; then
120120
echo "Rancher Desktop socket not found"
121121
exit 1
122122
fi
123-
123+
124124
echo "{}" > $HOME/.docker/config.json
125-
125+
126126
echo "DOCKER_HOST=unix://${HOME}/.rd/docker.sock" >> $GITHUB_ENV
127127
echo "TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock" >> $GITHUB_ENV
128128
echo "NODE_OPTIONS=--dns-result-order=ipv4first" >> $GITHUB_ENV
@@ -139,4 +139,4 @@ jobs:
139139
workspace: "${{ inputs.workspace }}"
140140

141141
- name: Run tests
142-
run: npm run test:ci -- ${{ steps.npm-install.outputs.workspace_path }}
142+
run: npm run test:ci -- --coverage.include=${{ steps.npm-install.outputs.workspace_path }} ${{ steps.npm-install.outputs.workspace_path }}

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"printWidth": 120
2+
"printWidth": 120,
3+
"plugins": [
4+
"prettier-plugin-organize-imports"
5+
]
36
}

docs/modules/hivemq.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# HiveMQ MQTT Module
22

33
This module allows automatic start up of [HiveMQ's](https://www.hivemq.com/) docker container within
4-
Jest suites, to enable programmatic testing of JavaScript based MQTT client applications.
4+
test suites, to enable programmatic testing of JavaScript based MQTT client applications.
55

66
## Install
77

@@ -11,18 +11,20 @@ npm install @testcontainers/hivemq --save-dev
1111

1212
## Resources
1313

14-
* [Community forum](https://community.hivemq.com/)
15-
* [HiveMQ website](https://www.hivemq.com/)
16-
* [MQTT Essentials](https://www.hivemq.com/mqtt-essentials/)
17-
* [MQTT 5 Essentials](https://www.hivemq.com/mqtt-5/)
14+
- [Community forum](https://community.hivemq.com/)
15+
- [HiveMQ website](https://www.hivemq.com/)
16+
- [MQTT Essentials](https://www.hivemq.com/mqtt-essentials/)
17+
- [MQTT 5 Essentials](https://www.hivemq.com/mqtt-5/)
1818

1919
Please make sure to check out the hivemq-docs for the [Community Edition](https://github.com/hivemq/hivemq-community-edition/wiki/).
2020

2121
!!! Info
22-
We are working to support the HiveMQ Enterprise Edition as outlined in the [Java Test Containers Module](https://java.testcontainers.org/modules/hivemq/).
22+
We are working to support the HiveMQ Enterprise Edition as outlined in the [Java Test Containers Module](https://java.testcontainers.org/modules/hivemq/).
2323

2424
## Examples
2525

2626
<!--codeinclude-->
27+
2728
[Connect with a mqtt.js client to HiveMQ](../../packages/modules/hivemq/src/hivemq-container.test.ts) inside_block:connect
29+
2830
<!--/codeinclude-->

jest.config.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)