Skip to content

Commit e7eb21f

Browse files
Merge pull request #2192 from contentstack/enhancement/DX-3579
feat: add test cases base-class and asssets for export module
2 parents 745936c + a8a9dfd commit e7eb21f

File tree

9 files changed

+1393
-363
lines changed

9 files changed

+1393
-363
lines changed

.talismanrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ fileignoreconfig:
123123
checksum: 7b984d292a534f9d075d801de2aeff802b2832bc5e2efadf8613a7059f4317fc
124124
- filename: packages/contentstack-import/test/unit/import/modules/labels.test.ts
125125
checksum: 46fe0d1602ab386f7eaee9839bc376b98ab8d4262f823784eda9cfa2bf893758
126+
- filename: packages/contentstack-export/test/unit/export/modules/assets.test.ts
127+
checksum: 192c515e32db3f5d8c4f47d57aa65597b41167f83e70ec9592e4deb88dc47802
128+
- filename: packages/contentstack-export/test/unit/export/modules/base-class.test.ts
129+
checksum: c7f9801faeb300f8bd97534ac72441bde5aac625dd4beaf5531945d14d9d4db0
126130
- filename: packages/contentstack-import/test/unit/import/modules/environments.test.ts
127131
checksum: 58165d06d92f55be8abb04c4ecc47df775a1c47f1cee529f1be5277187700f97
128132
version: "1.0"
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"require": [
3-
"test/helpers/init.js",
4-
"ts-node/register",
5-
"source-map-support/register"
6-
],
2+
"require": ["test/helpers/init.js", "ts-node/register", "source-map-support/register"],
73
"watch-extensions": [
84
"ts"
95
],
106
"recursive": true,
117
"timeout": 5000
12-
}
8+
}

packages/contentstack-export/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,21 @@
2727
"@oclif/plugin-help": "^6.2.28",
2828
"@oclif/test": "^4.1.13",
2929
"@types/big-json": "^3.2.5",
30+
"@types/chai": "^4.3.11",
3031
"@types/mkdirp": "^1.0.2",
32+
"@types/mocha": "^10.0.6",
3133
"@types/progress-stream": "^2.0.5",
34+
"@types/sinon": "^17.0.2",
35+
"chai": "^4.4.1",
3236
"dotenv": "^16.5.0",
3337
"dotenv-expand": "^9.0.0",
3438
"eslint": "^8.57.1",
3539
"eslint-config-oclif": "^6.0.68",
3640
"mocha": "10.8.2",
3741
"nyc": "^15.1.0",
3842
"oclif": "^4.17.46",
43+
"sinon": "^17.0.1",
44+
"source-map-support": "^0.5.21",
3945
"ts-node": "^10.9.2",
4046
"typescript": "^4.9.5"
4147
},
@@ -54,7 +60,8 @@
5460
"format": "eslint src/**/*.ts --fix",
5561
"test:integration": "INTEGRATION_TEST=true mocha --config ./test/.mocharc.js --forbid-only \"test/run.test.js\"",
5662
"test:integration:report": "INTEGRATION_TEST=true nyc --extension .js mocha --forbid-only \"test/run.test.js\"",
57-
"test:unit": "mocha --forbid-only \"test/unit/*.test.ts\""
63+
"test:unit": "mocha --forbid-only \"test/unit/**/*.test.ts\"",
64+
"test:unit:report": "nyc --reporter=text --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\""
5865
},
5966
"engines": {
6067
"node": ">=14.0.0"

packages/contentstack-export/test/helpers/init.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ process.env.NODE_ENV = 'development'
44

55
global.oclif = global.oclif || {}
66
global.oclif.columns = 80
7+
8+
// Minimal test helper for unit tests
9+
module.exports = {
10+
// Basic test utilities can be added here
11+
}

packages/contentstack-export/test/tsconfig.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
"extends": "../tsconfig",
33
"compilerOptions": {
44
"noEmit": true,
5-
"resolveJsonModule": true
6-
},
7-
"references": [
8-
{"path": "../"}
9-
]
5+
"resolveJsonModule": true,
6+
"esModuleInterop": true
7+
}
108
}

0 commit comments

Comments
 (0)