Groups
Conversations
All groups and messages
Send feedback to Google
Help
Training
Sign in
Groups
Mocha
Conversations
About
Groups keyboard shortcuts have been updated
Dismiss
See shortcuts
How to pass the values from terminal for mocha test?
645 views
Skip to first unread message
jyo rani
unread,
Nov 2, 2020, 4:30:50 PM
11/2/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mocha
I have to create ci for my mocha test to run on the stage environment and need to paratemeterize the value? can any one help with that?
i tried this
test.js
const BASE_URL = process.env.BASE_URL
console.log(BASE_URL);
package.json
"test": "mocha test BASE_URL=$BASE_URL --timeout 30000",
terminal command to run test
BASE_URL=
http://localhost:8000
npm run test
/node_modules/mocha/lib/utils.js:634
throw new Error("cannot resolve path (or pattern) '" + path + "'");
^
Error: cannot resolve path (or pattern) 'BASE_URL=
http://localhost:8000
'
Vlad GURDIGA
unread,
Nov 3, 2020, 3:02:11 AM
11/3/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mocha
Hi jsel! 👋
To set the environment variable for the
mocha
process, they should go before the name of the program: 🤓
BASE_URL=$BASE_URL mocha test --timeout 30000
Good luck! 🙂
Reply all
Reply to author
Forward
0 new messages