test('Test FAIL to create an index with a string param', (assert) => { OGMNeoIndex.create('object', '').catch((error) => { assert.equals(error.message, 'You must provide and label and an array with at least one field name or a string name'); assert.end(); }); });
(() => { nock(URL) .get('') .reply(200, 'hello world'); test(`Parse RSS feed: fail`, {timeout: 5000}, (t) => { parse(URL).catch((e) => { t.equals(e.message, `Parsing failed: ${URL}`, 'Error occurs while parsing RSS'); }).finally(t.end); }); })();
test('test default build location', (t) => { const projectArchiver = require('../lib/project-archiver'); t.equals(projectArchiver.DEFAULT_BUILD_LOCATION, 'tmp/nodeshift/build', 'tmp/nodeshift/build should be the default directory'); t.end(); });
test('[ms-bing-speech-service] method _start', function (t) { t.plan(1); const recognizer = new speechService({accessToken: 'abc'}); recognizer.start().then(() => { t.equals(typeof recognizer.sendFile, 'function', 'service object has sendFile function'); }).catch(console.error); });
test('test cleanup function - success', (t) => { const helpers = proxyquire('../lib/helpers', { './utils/rmrf': () => Promise.resolve() }); t.equal(typeof helpers.cleanUp, 'function', 'this module exports a function'); const p = helpers.cleanUp(); t.equals(p instanceof Promise, true, 'cleanUp function is a promise'); p.then(() => { t.pass('should pass'); t.end(); }); });
test('Class Module', (t) => { t.equals( 'function', typeof Klass, 'should export a function', ); t.end(); });
test('defaults to using latest ubi8/nodejs-10 s2i builder image', t => { const result = buildStrategy({ buildStrategy: 'Source' }); t.equals(result.sourceStrategy.from.name, 'registry.access.redhat.com/ubi8/nodejs-10:latest'); t.end(); });
test('basic imagestream module specs', (t) => { const imageStream = require('../lib/image-stream'); t.ok(imageStream.createOrUpdateImageStream, 'should have a createOrUpdateImageStream'); t.equals(typeof imageStream.createOrUpdateImageStream, 'function', 'should be a function'); t.end(); });
test('parse, alter and then stringify an empty file', t => { const actual = parse('', commentChar) const newLine = { key: 'new line here', value: '', comment: true } t.equals(stringify(actual.concat(newLine), commentChar), '#new line here', 'stringified empty rc') t.end() })
test('stringify rc file contents', t => { const actual = stringify(parsedData, commentChar) t.equals(actual, rawData, 'stringified rc') t.end() })
test('return error code 0 if no data passed in', function (t) { const cmd = 'echo "" | node ' + binfile exec(cmd, function (err, stdout, stderr) { t.equals(stdout, '[]\n', 'stdout is correct') t.error(err, 'correctly exits without error') t.end() }) })
test('Test FAIL to create index', (assert) => { OGMNeoIndex.create(null, ['name','tes']).catch((error) => { assert.equals(error.message, 'You must provide and string as label param'); assert.end(); }); });
test('Test FAIL to create index with invalid parameters', (assert) => { OGMNeoIndex.create('object', []).catch((error) => { assert.equals(error.message, 'You must provide and label and an array with at least one field name or a string name'); assert.end(); }); });
test('stringify pmuellr\'s parsed rc file', t => { const actual = stringify(parsedPmuellrData, commentChar) t.equals(actual, rawPmuellrData, 'stringified pmuellr\'s rc') t.end() })