UNPKG

674 BJavaScriptView Raw
1var sh = require('shelljs');
2var silentState = sh.config.silent; // save old silent state
3var authEnvs = 'MPKIT_URL=http://example.com MPKIT_TOKEN=1234 MPKIT_EMAIL=foo@example.com';
4
5test('should show message when wrong file for data import', () => {
6 sh.config.silent = true;
7 let command = sh.exec(`${authEnvs} ./marketplace-kit.js data import foo -p ./test/fixtures/wrong_json.json`);
8
9 expect(command.code).toEqual(1);
10 expect(command.stderr).toEqual(expect.stringContaining('Invalid format of ./test/fixtures/wrong_json.json. Must be a valid json file. Check file using one of JSON validators online: https://jsonlint.com'));
11 sh.config.silent = silentState;
12});