@palmares/tests
Version:
This defines a default test framework testing stuff inside of the framework
206 lines (202 loc) • 6.21 kB
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// src/adapter/expect.ts
var TestExpectAdapter = class {
static {
__name(this, "TestExpectAdapter");
}
toBe(_value, _expected, _isNot, _customData) {
throw new Error("Not implemented");
}
toEqual(_value, _expected, _isNot, _customData) {
throw new Error("Not implemented");
}
toStrictEqual(_value, _expected, _isNot, _customData) {
throw new Error("Not implemented");
}
toBeDefined(_value, _isNot, _customData) {
throw new Error("Not implemented");
}
toBeInstanceOf(__value, _expected, _isNot, _customData) {
throw new Error("Not implemented");
}
toHaveBeenCalled(_value, _isNot, _customData) {
throw new Error("Not implemented");
}
// eslint-disable-next-line ts/require-await
async toHaveBeenCalledTimes(_value, _isNot, _customData) {
throw new Error("Not implemented");
}
// eslint-disable-next-line ts/require-await
async toHaveBeenCalledWith(_value, _args, _isNot, _customData) {
throw new Error("Not implemented");
}
// eslint-disable-next-line ts/require-await
async toHaveReturned(_value, _isNot, _customData) {
throw new Error("Not implemented");
}
// eslint-disable-next-line ts/require-await
async toHaveReturnedTimes(_value, _expected, _isNot, _customData) {
throw new Error("Not implemented");
}
};
// src/adapter/functions.ts
var TestFunctionsAdapter = class {
static {
__name(this, "TestFunctionsAdapter");
}
/**
* Should run a callback inside a describe function from your test framework.
*
* @example
* ```typescript
* import { TestFunctionsAdapter } from '@palmares/tests';
*
* export default class JestTestFunctionsAdapter extends TestFunctionsAdapter {
* getDescribe(descriptionName: string, callback: () => void): void {
* const describe = require('@jest/globals').describe;
* describe(descriptionName, () => {
* callback();
* });
* }
* }
* ```
*
* @param descriptionName - The name of the description
* @param callback - The callback that should be called inside the describe function
*/
getDescribe(_descriptionName, _callback, _customData) {
throw new Error("Not implemented");
}
/**
* Should run a async callback function inside a `test` or `it` function from your test framework.
*
* @example
* ```typescript
* import { TestFunctionsAdapter } from '@palmares/tests';
*
* export default class JestTestFunctionsAdapter extends TestFunctionsAdapter {
* getTest(descriptionName: string, callback: () => Promise<void>): void {
* const test = require('@jest/globals').test;
* test(descriptionName, async () => {
* await callback();
* });
* }
* }
* ```
*
* @param testName - The name of the test
* @param callback - The callback that should be called inside the test function
*/
getTest(_testName, _callback, _customData) {
throw new Error("Not implemented");
}
/**
* Should run a callback inside a beforeEach function from your test framework.
*
* @example
* ```typescript
* import { TestFunctionsAdapter } from '@palmares/tests';
*
* export default class JestTestFunctionsAdapter extends TestFunctionsAdapter {
* getBeforeEach(callback: () => Promise<void>): void {
* const beforeEach = require('@jest/globals').beforeEach;
* beforeEach(async () => {
* await callback();
* });
* }
* }
* ```
*
* @param callback - The callback that should be called inside the beforeEach function
*/
getBeforeEach(_callback, _customData) {
throw new Error("Not implemented");
}
/**
* Should run a callback inside a afterEach function from your test framework.
*
* @example
* ```typescript
* import { TestFunctionsAdapter } from '@palmares/tests';
*
* export default class JestTestFunctionsAdapter extends TestFunctionsAdapter {
* getAfterEach(callback: () => Promise<void>): void {
* const afterEach = require('@jest/globals').afterEach;
* afterEach(async () => {
* await callback();
* });
* }
* }
* ```
*
* @param callback - The callback that should be called inside the beforeEach function
*/
getAfterEach(_callback, _customData) {
throw new Error("Not implemented");
}
/**
* Should run a callback inside a beforeAll function from your test framework.
*
* @example
* ```typescript
* import { TestFunctionsAdapter } from '@palmares/tests';
*
* export default class JestTestFunctionsAdapter extends TestFunctionsAdapter {
* getBeforeAll(callback: () => Promise<void>): void {
* const beforeAll = require('@jest/globals').beforeAll;
* beforeAll(async () => {
* await callback();
* });
* }
* }
* ```
*
* @param callback - The callback that should be called inside the beforeEach function
*/
getBeforeAll(_callback, _customData) {
throw new Error("Not implemented");
}
/**
* Should run a callback inside an afterAll function from your test framework.
*
* @example
* ```typescript
* import { TestFunctionsAdapter } from '@palmares/tests';
*
* export default class JestTestFunctionsAdapter extends TestFunctionsAdapter {
* getAfterAll(callback: () => Promise<void>): void {
* const afterAll = require('@jest/globals').afterAll;
* afterAll(async () => {
* await callback();
* });
* }
* }
* ```
*
* @param callback - The callback that should be called inside the beforeEach function
*/
getAfterAll(_callback, _customData) {
throw new Error("Not implemented");
}
};
// src/adapter/index.ts
var TestAdapter = class {
static {
__name(this, "TestAdapter");
}
functions = new TestFunctionsAdapter();
expect = new TestExpectAdapter();
// eslint-disable-next-line ts/require-await
async getCustomProps() {
throw new Error("Not implemented");
}
/** Should return */
// eslint-disable-next-line ts/require-await
async run(_filesToRun, _globalSetupFunctionBody, _std) {
throw new Error("Not implemented");
}
};
export {
TestAdapter
};