JSPM

@toolbuilder/rollup-plugin-test-tools

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q25742F
  • License MIT

Supports pack file testing for dual modules using Rollup.

Package Exports

  • @toolbuilder/rollup-plugin-test-tools

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 (@toolbuilder/rollup-plugin-test-tools) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Rollup Plugin Test Tools

This package supports pack file testing for dual module packages.

Here are the basic steps:

Installation

npm install @toolbuilder/rollup-plugin-test-tools

API

The re-exported packages are exported like this. Links to documentation for these packages are provided above.

export { default as createTestPackageJson } from 'rollup-plugin-create-test-package-json'
export { default as multiInput } from 'rollup-plugin-multi-input'
export { default as relativeToPackage } from 'rollup-plugin-relative-to-package'
export { default as createPackFile } from '@toolbuilder/rollup-plugin-create-pack-file'
export { default as runCommands, shellCommand } from '@toolbuilder/rollup-plugin-commands'

Configurations

The package exports two Rollup configurations. If they are suitable, do the following in your rollup.config.js:

export { testConfigs as default } from '@toolbuilder/rollup-plugin-test-tools'

The testConfigs object is an Array with two configurations. The first configuration tests your package in a CommonJS project, and the second configuration tests your package in an ES project. Rollup will run one after the other.

These configurations expect the following:

  • Unit tests are written using ES module
  • Unit tests produce TAP output and are standalone - I use zora becuase it also runs in the browser.
  • Unit tests match this glob test/**/*test.js
  • Source code matches this glob src/**/*.js
  • The pnpm package manager is installed on your system

NOTE: Since the pack file is being tested, the unit tests must use only package imports that are accessible when using the package. Specifically, the unit test imports must match the exports declared in the package.exports portion of package.json. If you have unit tests that import package internals, you can control which unit tests are used for pack file testing with glob specifications.

Stability

This package will be a bit looser interpreting the semver numbering for the test configurations.

Contributing

Contributions are welcome. Please create a pull request.

I use pnpm instead of npm, which is why you see pnpm-lock.yaml instead of npm lock files.

Issues

This project uses Github issues.

License

MIT