Skip to content

Commit be11afe

Browse files
fix: request command data and config files checking bug (#253)
* fix: request command data and config files checking bug * tests: fixed request parameter Co-authored-by: Krishna Acondy <[email protected]>
1 parent da84b2d commit be11afe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/commands/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function runSasJob(commandLine) {
2626
let dataJson
2727
let configJson
2828

29-
if (dataFilePath !== 'default') {
29+
if (dataFilePath) {
3030
if (dataFilePath.split('.').slice(-1)[0] !== 'json') {
3131
throw new Error('Provided data file must be valid json.')
3232
}
@@ -40,7 +40,7 @@ export async function runSasJob(commandLine) {
4040
}
4141
}
4242

43-
if (configFilePath !== 'default') {
43+
if (configFilePath) {
4444
if (configFilePath.split('.').slice(-1)[0] !== 'json') {
4545
throw new Error('Provided config file must be valid json.')
4646
}

test/commands/request/request.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('sasjs request', () => {
9393
async () => {
9494
await expect(
9595
runRequest(
96-
`request /Public/app/cli-tests-${timestamp}/runRequest/sendArr -d ${dataPathRel} -c default -t ${targetName}`
96+
`request /Public/app/cli-tests-${timestamp}/runRequest/sendArr -d ${dataPathRel} -t ${targetName}`
9797
)
9898
).resolves.toEqual(true)
9999
const rawData = await readFile(`${process.projectDir}/output.json`)
@@ -111,7 +111,7 @@ describe('sasjs request', () => {
111111
async () => {
112112
await expect(
113113
runRequest(
114-
`request /Public/app/cli-tests-${timestamp}/runRequest/sendObj -d ${dataPathRel} -c default -t ${targetName}`
114+
`request /Public/app/cli-tests-${timestamp}/runRequest/sendObj -d ${dataPathRel} -t ${targetName}`
115115
)
116116
).resolves.toEqual(true)
117117
const rawData = await readFile(`${process.projectDir}/output.json`)
@@ -131,7 +131,7 @@ describe('sasjs request', () => {
131131
async () => {
132132
await expect(
133133
runRequest(
134-
`request runRequest/sendArr -d ${dataPathRel} -c default -t ${targetName}`
134+
`request runRequest/sendArr -d ${dataPathRel} -t ${targetName}`
135135
)
136136
).resolves.toEqual(true)
137137

@@ -150,7 +150,7 @@ describe('sasjs request', () => {
150150
async () => {
151151
await expect(
152152
runRequest(
153-
`request runRequest/sendObj -d ${dataPathRel} -c default -t ${targetName}`
153+
`request runRequest/sendObj -d ${dataPathRel} -t ${targetName}`
154154
)
155155
).resolves.toEqual(true)
156156

0 commit comments

Comments
 (0)