ava-fixture
Advanced tools
Comparing version
@@ -1,29 +0,3 @@ | ||
import test, { ContextualCallbackTest, ContextualTest } from 'ava'; | ||
import test from 'ava'; | ||
import { FixtureTest } from './interfaces'; | ||
export declare namespace Ava { | ||
interface ContextualTestFunction { | ||
(name: string, run: ContextualTest): void; | ||
(run: ContextualTest): void; | ||
} | ||
interface TestFunction { | ||
(name: string, implementation: Test): void; | ||
(implementation: Test): void; | ||
} | ||
interface ContextualCallbackTestFunction { | ||
(name: string, run: ContextualCallbackTest): void; | ||
(run: ContextualCallbackTest): void; | ||
} | ||
interface Test extends ContextualTestFunction { | ||
before: ContextualTestFunction; | ||
after: ContextualTestFunction; | ||
beforeEach: TestFunction; | ||
afterEach: TestFunction; | ||
skip: ContextualTestFunction; | ||
only: ContextualTestFunction; | ||
serial: ContextualTestFunction; | ||
failing: ContextualCallbackTestFunction; | ||
cb: ContextualCallbackTestFunction; | ||
todo(name: string): void; | ||
} | ||
} | ||
/** | ||
@@ -35,2 +9,2 @@ * Creates fixture test. | ||
*/ | ||
export default function fixture(ava: typeof test, path: string): FixtureTest; | ||
export declare function fixture(ava: typeof test, path: string): FixtureTest; |
@@ -23,3 +23,3 @@ "use strict"; | ||
process.chdir(fixturePath); | ||
result = run(t, fixturePath, path_1.relative(cwd, fixturePath)); | ||
result = run(t, fixturePath); | ||
if (result && result.then) { | ||
@@ -56,4 +56,3 @@ return result.then(function (r) { | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = fixture; | ||
exports.fixture = fixture; | ||
//# sourceMappingURL=fixture.js.map |
@@ -1,2 +0,3 @@ | ||
export * from './fixture'; | ||
import { fixture } from './fixture'; | ||
export default fixture; | ||
export * from './interfaces'; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
__export(require("./fixture")); | ||
var fixture_1 = require("./fixture"); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = fixture_1.fixture; | ||
//# sourceMappingURL=index.js.map |
import { Test, ContextualTestContext, ContextualCallbackTestContext, Observable } from 'ava'; | ||
export declare type FixtureContextualTest = (t: ContextualTestContext, absolutePath: string, relativePath: string) => PromiseLike<any> | Iterator<any> | Observable | void; | ||
export declare type FixtureContextualSerialTest = (t: ContextualTestContext, absolutePath: string, relativePath: string) => void; | ||
export declare type FixtureContextualCallbackTest = (t: ContextualCallbackTestContext, absolutePath: string, relativePath: string) => void; | ||
/** | ||
* The fixture text context (the callback function). | ||
*/ | ||
export declare type FixtureContextualTest = (t: ContextualTestContext, cwd: string) => PromiseLike<any> | Iterator<any> | Observable | void; | ||
export declare type FixtureContextualSerialTest = (t: ContextualTestContext, cwd: string) => void; | ||
export declare type FixtureContextualCallbackTest = (t: ContextualCallbackTestContext, cwd: string) => void; | ||
export interface BeforeRunner { | ||
@@ -20,2 +23,3 @@ (title: string, run: Test): void; | ||
* @param run The test function. | ||
* In this function, `cwd` is the fixture case folder. | ||
*/ | ||
@@ -73,6 +77,6 @@ (title: string, caseName: string, run: FixtureContextualTest): void; | ||
todo(title: string): void; | ||
only(title: string, caseName: string, run: (t: ContextualTestContext, absolutePath: string, relativePath: string) => any): void; | ||
only(caseName: string, run: (t: ContextualTestContext, absolutePath: string, relativePath: string) => any): void; | ||
skip(title: string, caseName: string, run: (t: ContextualTestContext, absolutePath: string, relativePath: string) => any): void; | ||
skip(caseName: string, run: (t: ContextualTestContext, absolutePath: string, relativePath: string) => any): void; | ||
only(title: string, caseName: string, run: (t: ContextualTestContext, cwd: string) => any): void; | ||
only(caseName: string, run: (t: ContextualTestContext, cwd: string) => any): void; | ||
skip(title: string, caseName: string, run: (t: ContextualTestContext, cwd: string) => any): void; | ||
skip(caseName: string, run: (t: ContextualTestContext, cwd: string) => any): void; | ||
after(title: string, run: (t: ContextualTestContext) => void): void; | ||
@@ -79,0 +83,0 @@ after(run: (t: ContextualTestContext) => void): void; |
{ | ||
"name": "ava-fixture", | ||
"description": "Write fixture tests with ava", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"main": "dist/commonjs/index.js", | ||
@@ -6,0 +6,0 @@ "typings": "dist/commonjs/index.d.ts", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%22755
-5.13%19
-29.63%158
-12.71%