fastypest 1.3.2 → 1.3.4
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/.pnp.loader.mjs +2110 -2110
- package/.yarn/releases/yarn-4.2.2.cjs +894 -894
- package/.yarn/sdks/eslint/bin/eslint.js +20 -20
- package/.yarn/sdks/eslint/lib/api.js +20 -20
- package/.yarn/sdks/eslint/lib/unsupported-api.js +20 -20
- package/.yarn/sdks/eslint/package.json +14 -14
- package/.yarn/sdks/integrations.yml +5 -5
- package/.yarn/sdks/typescript/bin/tsc +20 -20
- package/.yarn/sdks/typescript/bin/tsserver +20 -20
- package/.yarn/sdks/typescript/lib/tsc.js +20 -20
- package/.yarn/sdks/typescript/lib/tsserver.js +232 -232
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +232 -232
- package/.yarn/sdks/typescript/lib/typescript.js +20 -20
- package/.yarn/sdks/typescript/package.json +10 -10
- package/.yarnrc.yml +1 -1
- package/CHANGELOG.md +7 -5
- package/LICENSE +674 -674
- package/README.md +42 -42
- package/eslint.config.mjs +28 -28
- package/package.json +81 -82
package/README.md
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
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/juanjoGonDev/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>
|
|
10
|
-
|
|
11
|
-
With this library, you can run your test suites without having to stop and restore the database in between them.
|
|
12
|
-
|
|
13
|
-
Currently compatible with:
|
|
14
|
-
|
|
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>
|
|
19
|
-
|
|
20
|
-
Install with npm
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
npm i -D fastypest
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
To use it, you must have inserted all the seeds beforehand, and before starting the tests, you must initialize it by indicating the typeorm connection configuration. You must execute restoreData after each test, so that the database is returned to its initial state.
|
|
27
|
-
|
|
28
|
-
Example of use with jest
|
|
29
|
-
|
|
30
|
-
> **Note**
|
|
31
|
-
> (I recommend using it in a [setupFilesAfterEnv](https://jestjs.io/es-ES/docs/configuration#setupfilesafterenv-array) file):
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
beforeAll(async () => {
|
|
35
|
-
fastypest = new Fastypest(connection);
|
|
36
|
-
await fastypest.init();
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
afterEach(async () => {
|
|
40
|
-
await fastypest.restoreData();
|
|
41
|
-
});
|
|
42
|
-
```
|
|
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/juanjoGonDev/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>
|
|
10
|
+
|
|
11
|
+
With this library, you can run your test suites without having to stop and restore the database in between them.
|
|
12
|
+
|
|
13
|
+
Currently compatible with:
|
|
14
|
+
|
|
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>
|
|
19
|
+
|
|
20
|
+
Install with npm
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
npm i -D fastypest
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To use it, you must have inserted all the seeds beforehand, and before starting the tests, you must initialize it by indicating the typeorm connection configuration. You must execute restoreData after each test, so that the database is returned to its initial state.
|
|
27
|
+
|
|
28
|
+
Example of use with jest
|
|
29
|
+
|
|
30
|
+
> **Note**
|
|
31
|
+
> (I recommend using it in a [setupFilesAfterEnv](https://jestjs.io/es-ES/docs/configuration#setupfilesafterenv-array) file):
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
beforeAll(async () => {
|
|
35
|
+
fastypest = new Fastypest(connection);
|
|
36
|
+
await fastypest.init();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
afterEach(async () => {
|
|
40
|
+
await fastypest.restoreData();
|
|
41
|
+
});
|
|
42
|
+
```
|
package/eslint.config.mjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import pluginJs from "@eslint/js";
|
|
2
|
-
import globals from "globals";
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
4
|
-
|
|
5
|
-
const common = {
|
|
6
|
-
files: ["src/**/*.ts"],
|
|
7
|
-
ignores: ["**/dist/*", "**/node_modules/*"],
|
|
8
|
-
rules: {
|
|
9
|
-
"no-case-declarations": "off",
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const tsRecommended = tseslint.configs.recommended.map((config) => ({
|
|
14
|
-
...config,
|
|
15
|
-
...common,
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
export default [
|
|
19
|
-
{
|
|
20
|
-
languageOptions: { globals: globals.node },
|
|
21
|
-
...common,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
...pluginJs.configs.recommended,
|
|
25
|
-
...common,
|
|
26
|
-
},
|
|
27
|
-
...tsRecommended,
|
|
28
|
-
];
|
|
1
|
+
import pluginJs from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
|
|
5
|
+
const common = {
|
|
6
|
+
files: ["src/**/*.ts"],
|
|
7
|
+
ignores: ["**/dist/*", "**/node_modules/*"],
|
|
8
|
+
rules: {
|
|
9
|
+
"no-case-declarations": "off",
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const tsRecommended = tseslint.configs.recommended.map((config) => ({
|
|
14
|
+
...config,
|
|
15
|
+
...common,
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
export default [
|
|
19
|
+
{
|
|
20
|
+
languageOptions: { globals: globals.node },
|
|
21
|
+
...common,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
...pluginJs.configs.recommended,
|
|
25
|
+
...common,
|
|
26
|
+
},
|
|
27
|
+
...tsRecommended,
|
|
28
|
+
];
|
package/package.json
CHANGED
|
@@ -1,82 +1,81 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fastypest",
|
|
3
|
-
"version": "1.3.
|
|
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
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=18.18.0"
|
|
9
|
-
},
|
|
10
|
-
"packageManager": "yarn@4.2.2",
|
|
11
|
-
"volta": {
|
|
12
|
-
"node": "18.18.0",
|
|
13
|
-
"yarn": "4.2.2"
|
|
14
|
-
},
|
|
15
|
-
"installConfig": {
|
|
16
|
-
"pnp": false
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"prebuild": "rimraf dist",
|
|
20
|
-
"build": "tsc",
|
|
21
|
-
"eslint": "eslint --fix .",
|
|
22
|
-
"pretest": "tsc",
|
|
23
|
-
"test": "jest --runInBand --config ./jest.config.json",
|
|
24
|
-
"docker": "ts-node -r tsconfig-paths/register scripts/prepare-docker.ts",
|
|
25
|
-
"release": "standard-version --release-as patch"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
"@
|
|
54
|
-
"@types/
|
|
55
|
-
"@types/
|
|
56
|
-
"@
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"eslint": "^
|
|
60
|
-
"eslint-
|
|
61
|
-
"eslint-plugin-
|
|
62
|
-
"eslint-plugin-
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"ts-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"typescript": "^
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "fastypest",
|
|
3
|
+
"version": "1.3.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
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18.18.0"
|
|
9
|
+
},
|
|
10
|
+
"packageManager": "yarn@4.2.2",
|
|
11
|
+
"volta": {
|
|
12
|
+
"node": "18.18.0",
|
|
13
|
+
"yarn": "4.2.2"
|
|
14
|
+
},
|
|
15
|
+
"installConfig": {
|
|
16
|
+
"pnp": false
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"prebuild": "rimraf dist",
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"eslint": "eslint --fix .",
|
|
22
|
+
"pretest": "tsc",
|
|
23
|
+
"test": "jest --runInBand --config ./jest.config.json",
|
|
24
|
+
"docker": "ts-node -r tsconfig-paths/register scripts/prepare-docker.ts",
|
|
25
|
+
"release": "standard-version --release-as patch"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/juanjoGonDev/fastypest.git"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"typeorm",
|
|
33
|
+
"test",
|
|
34
|
+
"transaction",
|
|
35
|
+
"rollback",
|
|
36
|
+
"nestjs",
|
|
37
|
+
"restore",
|
|
38
|
+
"db",
|
|
39
|
+
"speed",
|
|
40
|
+
"up",
|
|
41
|
+
"tests",
|
|
42
|
+
"jest",
|
|
43
|
+
"fastypest"
|
|
44
|
+
],
|
|
45
|
+
"author": "juanjoGonDev",
|
|
46
|
+
"license": "GPL",
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/juanjoGonDev/fastypest/issues"
|
|
49
|
+
},
|
|
50
|
+
"homepage": "https://github.com/juanjoGonDev/fastypest#readme",
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@eslint/js": "^9.2.0",
|
|
53
|
+
"@types/cross-spawn": "^6.0.6",
|
|
54
|
+
"@types/jest": "^29.5.12",
|
|
55
|
+
"@types/node": "^20.12.11",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^7.8.0",
|
|
57
|
+
"cross-spawn": "^7.0.3",
|
|
58
|
+
"eslint": "^9.2.0",
|
|
59
|
+
"eslint-config-standard-with-typescript": "^43.0.1",
|
|
60
|
+
"eslint-plugin-import": "^2.29.1",
|
|
61
|
+
"eslint-plugin-n": "^17.5.1",
|
|
62
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
63
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
64
|
+
"globals": "^15.2.0",
|
|
65
|
+
"jest": "^29.7.0",
|
|
66
|
+
"mariadb": "^3.3.0",
|
|
67
|
+
"mysql": "^2.18.1",
|
|
68
|
+
"pg": "^8.11.5",
|
|
69
|
+
"rimraf": "^5.0.5",
|
|
70
|
+
"standard-version": "^9.5.0",
|
|
71
|
+
"ts-jest": "^29.1.2",
|
|
72
|
+
"ts-node": "^10.9.2",
|
|
73
|
+
"tsconfig-paths": "^4.2.0",
|
|
74
|
+
"typeorm": "^0.3.20",
|
|
75
|
+
"typescript": "^5.4.5",
|
|
76
|
+
"typescript-eslint": "^7.8.0"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"typeorm": "^0.3.20"
|
|
80
|
+
}
|
|
81
|
+
}
|