Last active
February 12, 2025 09:01
-
-
Save radekbenkel/6cede03ae57d93d5d238667476e1851c to your computer and use it in GitHub Desktop.
nock@14 & testcontainers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { GenericContainer } from 'testcontainers'; | |
| import nock from 'nock'; | |
| const container = new GenericContainer("alpine"); | |
| const startedContainer = await container.start(); | |
| console.info('Container started'); | |
| await startedContainer.stop(); | |
| console.info('Container stopped'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "nock-testcontainers-test", | |
| "version": "1.0.0", | |
| "main": "index.mjs", | |
| "scripts": { | |
| "broken": "node broken.mjs", | |
| "working": "node working.mjs" | |
| }, | |
| "devDependencies": { | |
| "nock": "^14.0.1", | |
| "testcontainers": "^10.17.2" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { GenericContainer } from 'testcontainers'; | |
| // uncomment next line to see bug | |
| // import nock from 'nock'; | |
| const container = new GenericContainer("alpine"); | |
| const startedContainer = await container.start(); | |
| console.info('Container started'); | |
| await startedContainer.stop(); | |
| console.info('Container stopped'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment