Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Test your package in a sandbox 📦
⚠️ In development ⚠️
This package requires minimum Node.js 10
# with npm
npm install --save-dev karton
# with yarn
yarn add --dev karton
This package helps you with writing E2E tests for your packages. Example:
import {
createSandbox,
Sandbox,
packLocalPackage
} from "karton";
import path from 'path';
describe('my-package', () => {
let sandbox: Sandbox;
beforeAll(async () => {
sandbox = await createSandbox({
lockDirectory: path.resolve(__dirname, '__locks__'),
fixedDependencies: {
'my-package': `file:${await packLocalPackage(
path.resolve(__dirname, '../../')
)}`
}
});
});
afterEach(async () => {
await sandbox.reset();
});
afterAll(async () => {
await sandbox.cleanup();
})
it.each([
[{ 'webpack': '^4.0.0' }],
[{ 'webpack': '^5.0.0' }]
])('works with %p', async (dependencies) => {
await sandbox.load(path.join(__dirname, 'fixtures/basic'));
await sandbox.install('yarn', dependencies);
const result = await sandbox.exec('node src/test.js');
expect(result).toEqual('my-package awesome output');
});
})
MIT
FAQs
Create sandbox for package e2e tests
We found that karton demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.