https://github.com/toolbuilder/package-test
Tests NPM package pack file in a separate, temporary package, generates tests by transforming existing unit tests
https://github.com/toolbuilder/package-test
Last synced: 12 months ago
JSON representation
Tests NPM package pack file in a separate, temporary package, generates tests by transforming existing unit tests
- Host: GitHub
- URL: https://github.com/toolbuilder/package-test
- Owner: toolbuilder
- License: mit
- Created: 2020-04-28T14:20:40.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T06:16:13.000Z (almost 3 years ago)
- Last Synced: 2025-06-04T23:44:50.269Z (about 1 year ago)
- Language: JavaScript
- Size: 112 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Package-Test
This package is deprecated. Please use [@toolbuilder/rollup-config-pkg-test](https://github.com/toolbuilder/rollup-config-pkgtest) instead. The Rollup configuration `@toolbuilder/rollup-config-pkg-test` and plugins it uses are the result of refactoring this package. The plugins are far more configurable than this package.
This package tests the output of 'npm pack' in a separate, temporary, project. It does the following:
* Builds a temporary package in a temporary directory
* Uses rollup to create unit tests that import the package from ones that use relative imports
* Writes the new unit tests to the temporary package
* Installs the dependencies it found during the conversion
* Runs the unit tests
Options for input and output are provided. It has defaults that suit me.
## Installation
```bash
npm install --save @toolbuilder/package-test
# Or
pnpm add @toolbuilder/package-test
```
## Operation
This package provides a CLI (`cli.js`), and a programmatic API (`src/index.js`). A script called `package-test` is installed in `node_modules/.bin` when the package is installed. The script `package-test` provides access to the CLI.
```bash
pnpm add @toolbuilder/package-test
pnpx package-test --help
```
## Contributing
Yes, please! Or point out a better package, since I couldn't find any. This is a rough version just to get started testing my other packages.