Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tapjs/fixture

Package Overview
Dependencies
Maintainers
2
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tapjs/fixture - npm Package Compare versions

Comparing version 0.0.0-12 to 0.0.0-13

30

dist/cjs/index.d.ts

@@ -20,4 +20,32 @@ import { TapPlugin, TestBase } from '@tapjs/core';

constructor(t: TestBase, opts: TestFixturesOptions);
/**
* Create a fixture object for use in a
* {@link @tapjs/fixture!index.TestFixtures#testdir} method.
*
* @group Spies, Mocks, and Fixtures
*/
fixture<T extends FixtureType>(type: T, content: FixtureContent<T>): Fixture<T>;
/**
* Create a test directory, optionally filling it up with contents
*
* If the `@tapjs/after` plugin is loaded, the testdir will be automatically
* deleted at the end of the test.
*
* To _not_ delete the directory after the test, use the
* `saveFixture: true` option when creating the test, or specify
* `--save-fixture` on the command line or in the tap configuration.
*
* @group Spies, Mocks, and Fixtures
*/
testdir(content?: FixtureDirContent): string;
/**
* The name of the folder that this test will use with
* {@link @tapjs/fixture!index.TestFixtures#testdir}.
*
* By default, it uses a folder name based on the name of the test file
* and subtest, prepended with `tap-testdir-...`, which is automatically
* omitted from consideration in coverage and other analysis.
*
* @group Spies, Mocks, and Fixtures
*/
get testdirName(): string;

@@ -36,3 +64,3 @@ set testdirName(td: string);

*
* Do not clean up fixtures created with t.testdir()
* Do not clean up fixtures created with `t.testdir()`
*

@@ -39,0 +67,0 @@ * @group Configuration

@@ -42,5 +42,23 @@ "use strict";

}
/**
* Create a fixture object for use in a
* {@link @tapjs/fixture!index.TestFixtures#testdir} method.
*
* @group Spies, Mocks, and Fixtures
*/
fixture(type, content) {
return new fixture_js_1.Fixture(type, content);
}
/**
* Create a test directory, optionally filling it up with contents
*
* If the `@tapjs/after` plugin is loaded, the testdir will be automatically
* deleted at the end of the test.
*
* To _not_ delete the directory after the test, use the
* `saveFixture: true` option when creating the test, or specify
* `--save-fixture` on the command line or in the tap configuration.
*
* @group Spies, Mocks, and Fixtures
*/
testdir(content) {

@@ -62,2 +80,12 @@ const dir = (0, node_path_1.resolve)(this.testdirName);

}
/**
* The name of the folder that this test will use with
* {@link @tapjs/fixture!index.TestFixtures#testdir}.
*
* By default, it uses a folder name based on the name of the test file
* and subtest, prepended with `tap-testdir-...`, which is automatically
* omitted from consideration in coverage and other analysis.
*
* @group Spies, Mocks, and Fixtures
*/
get testdirName() {

@@ -108,3 +136,3 @@ return this.#testdir;

*
* Do not clean up fixtures created with t.testdir()
* Do not clean up fixtures created with `t.testdir()`
*

@@ -116,5 +144,5 @@ * @group Configuration

short: 'F',
description: 'Do not clean up fixtures created with t.testdir()',
description: 'Do not clean up fixtures created with `t.testdir()`',
},
};
//# sourceMappingURL=index.js.map

@@ -20,4 +20,32 @@ import { TapPlugin, TestBase } from '@tapjs/core';

constructor(t: TestBase, opts: TestFixturesOptions);
/**
* Create a fixture object for use in a
* {@link @tapjs/fixture!index.TestFixtures#testdir} method.
*
* @group Spies, Mocks, and Fixtures
*/
fixture<T extends FixtureType>(type: T, content: FixtureContent<T>): Fixture<T>;
/**
* Create a test directory, optionally filling it up with contents
*
* If the `@tapjs/after` plugin is loaded, the testdir will be automatically
* deleted at the end of the test.
*
* To _not_ delete the directory after the test, use the
* `saveFixture: true` option when creating the test, or specify
* `--save-fixture` on the command line or in the tap configuration.
*
* @group Spies, Mocks, and Fixtures
*/
testdir(content?: FixtureDirContent): string;
/**
* The name of the folder that this test will use with
* {@link @tapjs/fixture!index.TestFixtures#testdir}.
*
* By default, it uses a folder name based on the name of the test file
* and subtest, prepended with `tap-testdir-...`, which is automatically
* omitted from consideration in coverage and other analysis.
*
* @group Spies, Mocks, and Fixtures
*/
get testdirName(): string;

@@ -36,3 +64,3 @@ set testdirName(td: string);

*
* Do not clean up fixtures created with t.testdir()
* Do not clean up fixtures created with `t.testdir()`
*

@@ -39,0 +67,0 @@ * @group Configuration

@@ -25,5 +25,23 @@ // module code goes here

}
/**
* Create a fixture object for use in a
* {@link @tapjs/fixture!index.TestFixtures#testdir} method.
*
* @group Spies, Mocks, and Fixtures
*/
fixture(type, content) {
return new Fixture(type, content);
}
/**
* Create a test directory, optionally filling it up with contents
*
* If the `@tapjs/after` plugin is loaded, the testdir will be automatically
* deleted at the end of the test.
*
* To _not_ delete the directory after the test, use the
* `saveFixture: true` option when creating the test, or specify
* `--save-fixture` on the command line or in the tap configuration.
*
* @group Spies, Mocks, and Fixtures
*/
testdir(content) {

@@ -45,2 +63,12 @@ const dir = resolve(this.testdirName);

}
/**
* The name of the folder that this test will use with
* {@link @tapjs/fixture!index.TestFixtures#testdir}.
*
* By default, it uses a folder name based on the name of the test file
* and subtest, prepended with `tap-testdir-...`, which is automatically
* omitted from consideration in coverage and other analysis.
*
* @group Spies, Mocks, and Fixtures
*/
get testdirName() {

@@ -89,3 +117,3 @@ return this.#testdir;

*
* Do not clean up fixtures created with t.testdir()
* Do not clean up fixtures created with `t.testdir()`
*

@@ -97,5 +125,5 @@ * @group Configuration

short: 'F',
description: 'Do not clean up fixtures created with t.testdir()',
description: 'Do not clean up fixtures created with `t.testdir()`',
},
};
//# sourceMappingURL=index.js.map

4

package.json
{
"name": "@tapjs/fixture",
"version": "0.0.0-12",
"version": "0.0.0-13",
"description": "Tap plugin to provide t.testdir() and t.fixture()",

@@ -40,3 +40,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me)",

"peerDependencies": {
"@tapjs/core": "0.0.0-12"
"@tapjs/core": "0.0.0-13"
},

@@ -43,0 +43,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc