Package Exports
- testcontainers
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (testcontainers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
TestContainers
TestContainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
Usage
const testContainers = require('testcontainers')
describe('TestSubject', () => {
let mongo, redis
let testSubject
before(async () => {
mongo = await testContainers.startContainer({ image: 'mongo' })
redis = await testContainers.startContainer({ image: 'redis:alpine' })
})
after(async () => {
await testContainers.stopContainers()
})
beforeEach(() => {
testSubject = new TestSubject({
mongoConfig: { host: mongo.host, port: mongo.port },
redisConfig: { host: redis.host, port: redis.port }
})
})
})