Skip to content

Commit 28ff665

Browse files
fix: Remove deprecated test files and add environment variable checks
1 parent bdaed1a commit 28ff665

File tree

5 files changed

+9
-81
lines changed

5 files changed

+9
-81
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"test:sanity-test": "BABEL_ENV=test nyc --reporter=html mocha --require @babel/register ./test/sanity-check/sanity.js -t 30000 --reporter mochawesome --require babel-polyfill --reporter-options reportDir=mochawesome-report,reportFilename=mochawesome.json",
3434
"test:sanity": "npm run test:sanity-test || true",
3535
"test:sanity-report": "marge mochawesome-report/mochawesome.json -f sanity-report.html --inline && node sanity-report.mjs",
36-
"test:api": "BABEL_ENV=test nyc --reporter=html --reporter=text mocha --require @babel/register ./test/test.js -t 30000 --reporter mochawesome --require babel-polyfill",
3736
"test:unit": "BABEL_ENV=test nyc --reporter=html --reporter=text mocha --require @babel/register ./test/unit/index.js -t 30000 --reporter mochawesome --require babel-polyfill",
3837
"test:unit:report:json": "BABEL_ENV=test nyc --reporter=clover --reporter=text mocha --require @babel/register ./test/unit/index.js -t 30000 --reporter json --reporter-options output=report.json --require babel-polyfill",
3938
"test:typescript": "jest --testPathPattern=test/typescript --config ./jest.config.js --coverage",

test/sanity-check/utility/ContentstackClient.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
import * as contentstack from '../../../lib/contentstack.js'
22
import dotenv from 'dotenv'
33
dotenv.config()
4+
5+
const requiredVars = ['HOST', 'EMAIL', 'PASSWORD', 'ORGANIZATION', 'API_KEY']
6+
const missingVars = requiredVars.filter((key) => !process.env[key])
7+
8+
if (missingVars.length > 0) {
9+
console.error(`\x1b[31mError: Missing environment variables - ${missingVars.join(', ')}`)
10+
process.exit(1)
11+
}
12+
413
function contentstackClient (authtoken = null) {
514
var params = { host: process.env.HOST, defaultHostName: process.env.DEFAULTHOST }
615
if (authtoken) {

test/test.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

test/utility/ContentstackClient.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/utility/fileOperations/readwrite.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)