Skip to content

Commit eb9833f

Browse files
Merge pull request #2012 from contentstack/task/dx-3023
Added unit testcases for contentstack seed plugin
2 parents b95500f + 4817b46 commit eb9833f

File tree

13 files changed

+1431
-370
lines changed

13 files changed

+1431
-370
lines changed

.github/workflows/unit-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
- name: Run tests for Contentstack Bootstrap
4444
working-directory: ./packages/contentstack-bootstrap
4545
run: npm run test
46+
47+
- name: Run tests for Contentstack Seed
48+
working-directory: ./packages/contentstack-seed
49+
run: npm run test
50+
4651
# - name: Fetch latest references
4752
# run: |
4853
# git fetch --prune

.talismanrc

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
fileignoreconfig:
22
- filename: pnpm-lock.yaml
3-
checksum: 0c320557538f6b52f375b13221323d8700692a45e744128788785f27e7c72f73
3+
checksum: 7b4a6670a4cd1cf616eec40c6377fb2bdcfc7bb25fb85a0bf2eea9595f00125a
44
- filename: packages/contentstack-import/test/integration/auth-token-modules/environments.test.js
55
checksum: bc6f06b75d082aaf99e2f2f4b932b143765e2f14086967fb8973fe1b2ca6c03e
66
- filename: packages/contentstack-import/test/integration/environments.test.js
77
checksum: e71f033dad8944ffeafdf22d0514bda1d20c43e8fea0d62c96e774f3414beb31
88
- filename: package-lock.json
9-
checksum: 33f99a3796b81ae3f00155f3ab4c4c6e0b54c8b445d79efaac6e56a8abf93026
9+
checksum: 29f6700cc1623a9e8325f66ca78c00d6d3ed60001b8e071473f68820a1be5088
1010
- filename: packages/contentstack-auth/test/unit/tokens-validation.test.ts
1111
checksum: 676052e30d31a771ce68302d89b050d176bbef50f3abc7e9cdd4384f0e274e10
1212
- filename: packages/contentstack-import/test/integration/auth-token.test.js
@@ -59,7 +59,14 @@ fileignoreconfig:
5959
checksum: 59001d937245a8d1062a4a53206e1bb2d6d1a85633165e6e6749f1d5fc1bd817
6060
- filename: packages/contentstack/README.md
6161
checksum: d6da4ce77d52464737a4f22034f62fb93e47ec9200f8f788f06dbcedaae123b3
62-
62+
- filename: packages/contentstack-seed/tests/contentstack.test.ts
63+
checksum: b7c753682ba8e8105caf026ba4dae3b02864b621b98d47e57cd3c6d6107283e5
64+
- filename: packages/contentstack-seed/tests/importer.test.ts
65+
checksum: 51028781604ba60fa32b37d5a3bdde76f888694ef669c10f74eeb97e8410883e
66+
- filename: packages/contentstack-seed/tests/interactive.test.ts
67+
checksum: 7ade4a6fa1a37089458c72e1bbe3c5b3844c3169ec1e0da9fd3a944a21dc433b
68+
- filename: packages/contentstack-seed/tests/seeder.test.ts
69+
checksum: 12e25a13d3ee93b362948716c5d84db37ec15cc90c3c46c6d1000309f9bf06f0
6370
- filename: packages/contentstack-export/src/export/modules/environments.ts
6471
checksum: bc5c1187d6c0473abb680238e63ab892b73f5f5c702275211c06eb27ed685ff8
6572
- filename: packages/contentstack-import/src/import/modules/environments.ts

package-lock.json

Lines changed: 266 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-seed/.eslintrc

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
{
2-
"extends": [
3-
"oclif",
4-
"oclif-typescript"
5-
],
6-
"rules": {
7-
"unicorn/no-abusive-eslint-disable": "off",
8-
"@typescript-eslint/no-use-before-define": "off",
9-
"@typescript-eslint/ban-ts-ignore": "off"
10-
}
11-
}
2+
"extends": [
3+
"eslint:recommended"
4+
],
5+
"env": {
6+
"node": true,
7+
"es6": true,
8+
"jest": true
9+
},
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"ecmaVersion": 2020,
13+
"sourceType": "module"
14+
},
15+
"plugins": [
16+
"@typescript-eslint"
17+
],
18+
"rules": {
19+
"no-unused-vars": "warn",
20+
"no-console": "off",
21+
"no-debugger": "warn",
22+
"node/shebang": "off",
23+
"unicorn/prefer-top-level-await": "off"
24+
},
25+
"ignorePatterns": [
26+
"lib/**",
27+
"types/**",
28+
"bin/**",
29+
"node_modules/**"
30+
]
31+
}

packages/contentstack-seed/jest.config.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ module.exports = {
33
"<rootDir>"
44
],
55
"testMatch": [
6-
"**/tests/**/*.+(ts|tsx)",
7-
"**/?(*.)+(spec|test).+(ts|tsx)"
6+
"**/tests/**/*.+(ts|tsx|js|jsx)",
7+
"**/?(*.)+(spec|test).+(ts|tsx|js|jsx)"
88
],
99
"transform": {
10-
"^.+\\.(ts|tsx)$": "ts-jest"
10+
"^.+\\.(ts|tsx)$": ["ts-jest", {
11+
"tsconfig": "tsconfig.json"
12+
}]
1113
},
14+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json"],
15+
"testEnvironment": "node",
16+
"transformIgnorePatterns": [
17+
"node_modules/(?!(@contentstack)/)"
18+
]
1219
}

0 commit comments

Comments
 (0)