fastypest 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,21 @@
1
- # Fastypest
1
+ <h1 align="center">FASTYPEST</h1>
2
+ <p align="center">
3
+ <a href="https://www.npmjs.com/fastypest" target="_blank"><img alt="GitHub package.json version" src="https://img.shields.io/github/package-json/v/juanjo96dev/fastypest?logo=github&logoColor=fff&label=GitHub+package"></a>
4
+ <a href="https://www.npmjs.com/fastypest" target="_blank"><img alt="npm" src="https://img.shields.io/npm/v/fastypest?logo=npm&logoColor=fff&label=NPM+package"></a>
5
+ <a href="https://www.npmjs.com/fastypest" target="_blank"><img alt="npm peer dependency version" src="https://img.shields.io/npm/dependency-version/fastypest/peer/typeorm"></a>
6
+ <a href="https://www.npmjs.com/fastypest" target="_blank"><img alt="Node version" src="https://img.shields.io/node/v/fastypest"></a>
7
+ <a href="https://www.npmjs.com/fastypest" target="_blank"><img src="https://img.shields.io/npm/l/fastypest" alt="Package License" /></a>
8
+ <a href="https://www.npmjs.com/fastypest" target="_blank"><img src="https://img.shields.io/npm/dm/fastypest" alt="NPM Downloads" /></a>
9
+ </p>
2
10
 
3
11
  With this library, you can run your test suites without having to stop and restore the database in between them.
4
12
 
5
13
  Currently compatible with:
6
14
 
7
- - Mysql
8
- - MariaDB
9
- - Postgres
15
+ - <a href="https://www.npmjs.com/fastypest"><img alt="Mysql >= v5.7 supported" src="https://img.shields.io/badge/Mysql-%3E%3D5.7-informational"></a>
16
+ - <a href="https://www.npmjs.com/fastypest"><img alt="MariaDB >= v10.0 supported" src="https://img.shields.io/badge/MariaDB-%3E%3D10.0-yellowgreen"></a>
17
+ - <a href="https://www.npmjs.com/fastypest"><img alt="Postgres >= v9.0 supported" src="https://img.shields.io/badge/Postgres-%3E%3D9.0-green"></a>
18
+ - <a href="https://www.npmjs.com/fastypest"><img alt="cockroachdb >= v22.2.0 supported" src="https://img.shields.io/badge/Cockroachdb-%3E%3D22.2.0-blue"></a>
10
19
 
11
20
  Install with npm
12
21
 
@@ -0,0 +1,10 @@
1
+ import { Connection, DataSource } from "typeorm";
2
+ import { SQLScript } from "./sql-script";
3
+ export declare class Fastypest extends SQLScript {
4
+ private manager;
5
+ private tables;
6
+ constructor(connection: DataSource | Connection);
7
+ init(): Promise<void>;
8
+ restoreData(): Promise<void>;
9
+ clearTempTables(): Promise<void>;
10
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Fastypest = void 0;
13
+ const sql_script_1 = require("./sql-script");
14
+ class Fastypest extends sql_script_1.SQLScript {
15
+ constructor(connection) {
16
+ super(connection.options.type);
17
+ this.tables = new Set();
18
+ this.manager = connection.manager;
19
+ }
20
+ init() {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ yield this.manager.transaction((em) => __awaiter(this, void 0, void 0, function* () {
23
+ (yield em.query(this.getQuery("getTables"))).map((row) => {
24
+ this.tables.add(row.name);
25
+ });
26
+ yield Promise.all([...this.tables].map((tableName) => __awaiter(this, void 0, void 0, function* () {
27
+ yield em.query(this.getQuery("createTempTable", { tableName }));
28
+ })));
29
+ }));
30
+ });
31
+ }
32
+ restoreData() {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ yield this.manager.transaction((em) => __awaiter(this, void 0, void 0, function* () {
35
+ yield em.query(this.getQuery("foreignKey.disable"));
36
+ yield Promise.all([...this.tables].map((tableName) => __awaiter(this, void 0, void 0, function* () {
37
+ yield em.query(this.getQuery("truncateTable", { tableName }));
38
+ yield em.query(this.getQuery("restoreData", { tableName }));
39
+ })));
40
+ yield em.query(this.getQuery("foreignKey.enable"));
41
+ }));
42
+ });
43
+ }
44
+ clearTempTables() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ yield this.manager.transaction((em) => __awaiter(this, void 0, void 0, function* () {
47
+ yield Promise.all([...this.tables].map((tableName) => __awaiter(this, void 0, void 0, function* () {
48
+ yield em.query(yield em.query(this.getQuery("dropTempTable", { tableName })));
49
+ })));
50
+ }));
51
+ this.tables.clear();
52
+ });
53
+ }
54
+ }
55
+ exports.Fastypest = Fastypest;
56
+ //# sourceMappingURL=fastypest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fastypest.js","sourceRoot":"","sources":["../../src/core/fastypest.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,6CAAyC;AAEzC,MAAa,SAAU,SAAQ,sBAAS;IAItC,YAAY,UAAmC;QAC7C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAHzB,WAAM,GAAgB,IAAI,GAAG,EAAE,CAAC;QAItC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACpC,CAAC;IAEK,IAAI;;YACR,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAO,EAAE,EAAE,EAAE;gBAC1C,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,CAC9C,CAAC,GAA2B,EAAE,EAAE;oBAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;gBAC5B,CAAC,CACF,CAAC;gBAEF,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAO,SAAS,EAAE,EAAE;oBACvC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;gBAClE,CAAC,CAAA,CAAC,CACH,CAAC;YACJ,CAAC,CAAA,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,WAAW;;YACf,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAO,EAAE,EAAE,EAAE;gBAC1C,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC;gBAEpD,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAO,SAAS,EAAE,EAAE;oBACvC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;oBAC9D,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;gBAC9D,CAAC,CAAA,CAAC,CACH,CAAC;gBAEF,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACrD,CAAC,CAAA,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,eAAe;;YACnB,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAO,EAAE,EAAE,EAAE;gBAC1C,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAO,SAAS,EAAE,EAAE;oBACvC,MAAM,EAAE,CAAC,KAAK,CACZ,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC,CAC9D,CAAC;gBACJ,CAAC,CAAA,CAAC,CACH,CAAC;YACJ,CAAC,CAAA,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACtB,CAAC;KAAA;CACF;AArDD,8BAqDC"}
@@ -0,0 +1 @@
1
+ export * from "./fastypest";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./fastypest"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
@@ -0,0 +1 @@
1
+ export * from "./sql-script";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./sql-script"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/sql-script/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "foreignKey": {
3
+ "disable": "SET sql_safe_updates = 'off'",
4
+ "enable": "SET sql_safe_updates = 'on'"
5
+ },
6
+ "getTables": "SELECT table_name AS name FROM information_schema.tables WHERE table_catalog = CURRENT_DATABASE() AND table_schema = 'public' AND table_type = 'BASE TABLE'",
7
+ "createTempTable": "SET experimental_enable_temp_tables=on; CREATE TEMPORARY TABLE {{tableName}}_temp AS SELECT * FROM {{tableName}}",
8
+ "dropTempTable": "DROP TABLE IF EXISTS {{tableName}}_temp",
9
+ "restoreData": "INSERT INTO {{tableName}} SELECT * FROM {{tableName}}_temp; SELECT setval(pg_get_serial_sequence('{{tableName}}', 'id'), (SELECT COALESCE(MAX(id), 0) FROM {{tableName}}))",
10
+ "truncateTable": "TRUNCATE TABLE {{tableName}}; ALTER SEQUENCE {{tableName}}_id_seq RESTART WITH 1;"
11
+ }
@@ -0,0 +1,48 @@
1
+ export declare const DB_QUERIES: {
2
+ mysql: {
3
+ foreignKey: {
4
+ disable: string;
5
+ enable: string;
6
+ };
7
+ getTables: string;
8
+ createTempTable: string;
9
+ dropTempTable: string;
10
+ restoreData: string;
11
+ truncateTable: string;
12
+ };
13
+ mariadb: {
14
+ foreignKey: {
15
+ disable: string;
16
+ enable: string;
17
+ };
18
+ getTables: string;
19
+ createTempTable: string;
20
+ dropTempTable: string;
21
+ restoreData: string;
22
+ truncateTable: string;
23
+ };
24
+ postgres: {
25
+ foreignKey: {
26
+ disable: string;
27
+ enable: string;
28
+ };
29
+ getTables: string;
30
+ createTempTable: string;
31
+ dropTempTable: string;
32
+ restoreData: string;
33
+ truncateTable: string;
34
+ };
35
+ cockroachdb: {
36
+ foreignKey: {
37
+ disable: string;
38
+ enable: string;
39
+ };
40
+ getTables: string;
41
+ createTempTable: string;
42
+ dropTempTable: string;
43
+ restoreData: string;
44
+ truncateTable: string;
45
+ };
46
+ };
47
+ export type AllowedDataBases = keyof typeof DB_QUERIES;
48
+ export type Queries = (typeof DB_QUERIES)[AllowedDataBases];
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DB_QUERIES = void 0;
7
+ const cockroachdb_json_1 = __importDefault(require("./cockroachdb.json"));
8
+ const mysql_query_json_1 = __importDefault(require("./mysql.query.json"));
9
+ const postgres_query_json_1 = __importDefault(require("./postgres.query.json"));
10
+ exports.DB_QUERIES = {
11
+ mysql: mysql_query_json_1.default,
12
+ mariadb: mysql_query_json_1.default,
13
+ postgres: postgres_query_json_1.default,
14
+ cockroachdb: cockroachdb_json_1.default,
15
+ };
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/sql-script/queries/index.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAqD;AACrD,0EAA+C;AAC/C,gFAAqD;AAExC,QAAA,UAAU,GAAG;IACxB,KAAK,EAAE,0BAAa;IACpB,OAAO,EAAE,0BAAa;IACtB,QAAQ,EAAE,6BAAgB;IAC1B,WAAW,EAAE,0BAAmB;CACjC,CAAC"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "foreignKey": {
3
+ "disable": "SET FOREIGN_KEY_CHECKS=0",
4
+ "enable": "SET FOREIGN_KEY_CHECKS=1"
5
+ },
6
+ "getTables": "SELECT table_name AS name FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type = 'BASE TABLE'",
7
+ "createTempTable": "CREATE TEMPORARY TABLE {{tableName}}_temp AS SELECT * FROM {{tableName}}",
8
+ "dropTempTable": "DROP TEMPORARY TABLE {{tableName}}_temp",
9
+ "restoreData": "INSERT INTO {{tableName}} SELECT * FROM {{tableName}}_temp",
10
+ "truncateTable": "TRUNCATE TABLE {{tableName}}"
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "foreignKey": {
3
+ "disable": "SET CONSTRAINTS ALL DEFERRED",
4
+ "enable": "SET CONSTRAINTS ALL IMMEDIATE"
5
+ },
6
+ "getTables": "SELECT table_name AS name FROM information_schema.tables WHERE table_schema = CURRENT_SCHEMA() AND table_type = 'BASE TABLE'",
7
+ "createTempTable": "CREATE TEMPORARY TABLE {{tableName}}_temp AS SELECT * FROM {{tableName}}",
8
+ "dropTempTable": "DROP TABLE IF EXISTS {{tableName}}_temp",
9
+ "restoreData": "INSERT INTO {{tableName}} SELECT * FROM {{tableName}}_temp; SELECT SETVAL(pg_get_serial_sequence('{{tableName}}', 'id'), (SELECT COALESCE(MAX(id), 0) FROM {{tableName}}))",
10
+ "truncateTable": "TRUNCATE TABLE {{tableName}} RESTART IDENTITY"
11
+ }
@@ -0,0 +1,11 @@
1
+ import { DataSourceOptions } from "typeorm";
2
+ import { Queries } from "./queries";
3
+ import { QueryPath } from "./types";
4
+ type DBTypes = DataSourceOptions["type"];
5
+ export declare class SQLScript {
6
+ private readonly type;
7
+ queries: Queries;
8
+ constructor(type: DBTypes);
9
+ protected getQuery(queryPath: QueryPath<Queries>, values?: Record<string, string>): string;
10
+ }
11
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SQLScript = void 0;
4
+ const queries_1 = require("./queries");
5
+ class SQLScript {
6
+ constructor(type) {
7
+ this.type = type;
8
+ if (!(this.type in queries_1.DB_QUERIES)) {
9
+ throw new Error(`The database type provided is not supported. Please choose from the following: ${Object.keys(queries_1.DB_QUERIES)}`);
10
+ }
11
+ this.queries = queries_1.DB_QUERIES[this.type];
12
+ }
13
+ getQuery(queryPath, values) {
14
+ const queryObj = queryPath
15
+ .split(".")
16
+ .reduce((obj, key) => obj[key], this.queries);
17
+ let queryStr = queryObj;
18
+ for (const key in values) {
19
+ queryStr = queryStr.replace(new RegExp(`{{\\s*${key}\\s*}}`, "g"), values[key]);
20
+ }
21
+ return queryStr;
22
+ }
23
+ }
24
+ exports.SQLScript = SQLScript;
25
+ //# sourceMappingURL=sql-script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql-script.js","sourceRoot":"","sources":["../../../src/core/sql-script/sql-script.ts"],"names":[],"mappings":";;;AACA,uCAAkE;AAKlE,MAAa,SAAS;IAEpB,YAA6B,IAAa;QAAb,SAAI,GAAJ,IAAI,CAAS;QACxC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,oBAAU,CAAC,EAAE;YAC9B,MAAM,IAAI,KAAK,CACb,kFAAkF,MAAM,CAAC,IAAI,CAC3F,oBAAU,CACX,EAAE,CACJ,CAAC;SACH;QAED,IAAI,CAAC,OAAO,GAAG,oBAAU,CAAC,IAAI,CAAC,IAAwB,CAAC,CAAC;IAC3D,CAAC;IAES,QAAQ,CAChB,SAA6B,EAC7B,MAA+B;QAE/B,MAAM,QAAQ,GAAG,SAAS;aACvB,KAAK,CAAC,GAAG,CAAC;aACV,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAErD,IAAI,QAAQ,GAAG,QAAQ,CAAC;QAExB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACxB,QAAQ,GAAG,QAAQ,CAAC,OAAO,CACzB,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,EACrC,MAAM,CAAC,GAAG,CAAC,CACZ,CAAC;SACH;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAjCD,8BAiCC"}
@@ -0,0 +1 @@
1
+ export * from "./query-path";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./query-path"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/sql-script/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
@@ -0,0 +1,6 @@
1
+ type JsonKeys<T> = T extends object ? {
2
+ [K in keyof T]-?: `${string & K}` | `${JsonKeys<T[K]> & `.${string & K}`}`;
3
+ }[keyof T] : "";
4
+ type FlattenJson<T, K = JsonKeys<T>> = K extends keyof T ? T[K] extends Record<string, any> ? `${string & K}.${FlattenJson<T[K]>}` : K : never;
5
+ export type QueryPath<T> = FlattenJson<T>;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=query-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-path.js","sourceRoot":"","sources":["../../../../src/core/sql-script/types/query-path.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export * from "./core";
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./core"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB"}
package/package.json CHANGED
@@ -1,14 +1,21 @@
1
1
  {
2
2
  "name": "fastypest",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "Restores the database automatically after each test. Allows serial execution of tests without having to delete and restore the database having to stop the application",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "engines": {
8
+ "node": ">=18"
9
+ },
10
+ "volta": {
11
+ "node": "18.0.0"
12
+ },
7
13
  "scripts": {
8
14
  "prebuild": "rimraf dist",
9
15
  "build": "tsc",
10
16
  "eslint": "eslint . --fix --config .eslintrc",
11
- "test": "jest --runInBand --config ./jest.config.json"
17
+ "test": "jest --runInBand --config ./jest.config.json",
18
+ "docker": "ts-node -r tsconfig-paths/register scripts/prepare-docker.ts"
12
19
  },
13
20
  "repository": {
14
21
  "type": "git",
@@ -33,12 +40,13 @@
33
40
  "bugs": {
34
41
  "url": "https://github.com/juanjo96Dev/fastypest/issues"
35
42
  },
36
- "homepage": "https://github.com/juanjo96Dev/fastypestb#readme",
43
+ "homepage": "https://github.com/juanjo96Dev/fastypest#readme",
37
44
  "devDependencies": {
38
- "@types/dotenv": "^8.2.0",
45
+ "@types/cross-spawn": "^6.0.2",
39
46
  "@types/jest": "^29.4.0",
40
47
  "@types/node": "^18.13.0",
41
- "@typescript-eslint/eslint-plugin": "^5.52.0",
48
+ "@typescript-eslint/eslint-plugin": "^5.54.0",
49
+ "cross-spawn": "^7.0.3",
42
50
  "eslint": "^8.34.0",
43
51
  "eslint-config-standard-with-typescript": "^34.0.0",
44
52
  "eslint-plugin-import": "^2.27.5",
@@ -49,7 +57,7 @@
49
57
  "mariadb": "^3.1.0",
50
58
  "mysql": "^2.18.1",
51
59
  "pg": "^8.9.0",
52
- "rimraf": "^4.1.2",
60
+ "rimraf": "^4.3.0",
53
61
  "ts-jest": "^29.0.5",
54
62
  "ts-node": "^10.9.1",
55
63
  "typescript": "^4.9.5"