@tapjs/fixture
Advanced tools
Comparing version 0.0.0-12 to 0.0.0-13
@@ -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 |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62211
681