Is it acceptable to create tests relying on docker for a node.js module?

I currently have a module which needs to be tested in different scenarios.

But to improve the tests I have a lot of file copying and child-process execs to do.

  • How to specify cpu percent of host usage for container in fig
  • Elasticsearch in docker container cluster
  • What are the pros and cons of docker data volumes
  • WebSockets on Elastic Beanstalk with Docker
  • Express does not run on docker, but on localhost
  • Docker: Could not get container for XXX
  • Maybe Docker would be a good solution to run the tests, but this would add a dependency on Docker.

    Also I haven’t seen packages relying on docker for such scenarios so far.

    So for an npm package, would it be acceptable to publish a package with tests relying on docker?

  • pass arguments from docker run to dockerfile
  • How to change owner of Docker for Windows
  • Use --build-arg value in Dockerfile FROM parameter
  • How does mirror registry work in docker?
  • Pathload from Docker container
  • Docker image error: “/bin/sh: 1: [python,: not found”
  • One Solution collect form web for “Is it acceptable to create tests relying on docker for a node.js module?”

    I’d first think about your intended audience – how likely is it that users downloading your module will already have Docker installed?

    If your module is already Docker related, it’s fare to assume most users will already have Docker. If it’s a util for handling React routes, probably not.

    You should also consider the impact of not testing certain difficult to test features vs the difficulty or complexity created by testing them.

    For the vast majority of people using npm modules, they rarely run the tests anyway. Running tests is reserved for people who actively want to develop and contribute to modules.

    One common approach which might fit your problem is to include the Docker setup and tests in the project but exclude them from the actual module itself. In your package.json for the module, you can include a files property which defines which files should actually be included when publishing the module.

    With this approach you can setup and run tests in a way that suits you – and is available for any helpful contributors if they want it – but doesn’t burden day-to-day users with extra setup they don’t need.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.