Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exec('node ' + tmpPath + '/scripts/suit-conformance', function(err, stdout, stderr) {
if (err) {
console.log(err);
assert(false, 'Suit Conformance errors found.');
}
if (stdout) {
assert(!/warning/.test(stdout), stdout);
}
if (stderr) {
console.error(stderr);
assert(false, 'Suit Conformance errors found.');
}
done();
});
}));
it('can be imported without blowing up', function () {
assert(require('../app') !== undefined);
});
});
it('can be imported without blowing up', function () {
assert(require('../app') !== undefined);
});
});
it('replaces {{RESOURCE_NAME}} in spec file with promped value', function () {
var rootController = fs.readFileSync(path.join(os.tmpdir(), './temp-test') + '/src/resources/test_resource_name/test_resource_name.spec.js', 'utf-8');
assert(rootController.indexOf('test_resource_name') !== -1, true);
});
it('recognizes GitHub domain', function () {
assert(prompt.isGitHub('http://example.github.io'), 'http://example.github.io');
assert(prompt.isGitHub('https://example.github.io'), 'https://example.github.io');
assert(prompt.isGitHub('http://owner.github.io/project'), 'http://owner.github.io/project');
assert(!prompt.isGitHub('http://www.example.org'), 'http://www.example.org');
});
it('recognizes GitHub domain', function () {
assert(prompt.isGitHub('http://example.github.io'), 'http://example.github.io');
assert(prompt.isGitHub('https://example.github.io'), 'https://example.github.io');
assert(prompt.isGitHub('http://owner.github.io/project'), 'http://owner.github.io/project');
assert(!prompt.isGitHub('http://www.example.org'), 'http://www.example.org');
});
it('replaces {{API_NAME}} and {{API_PORTAL}} on root controller file with promped values', function () {
var rootController = fs.readFileSync(path.join(os.tmpdir(), './temp-test') + '/src/resources/root/root.controller.js', 'utf-8');
assert(rootController.indexOf('Test API TEST') !== -1, true);
assert(rootController.indexOf('http://dev.api.com') !== -1, true);
});
});
it('recognizes GitHub domain', function () {
assert(prompt.isGitHub('http://example.github.io'), 'http://example.github.io');
assert(prompt.isGitHub('https://example.github.io'), 'https://example.github.io');
assert(prompt.isGitHub('http://owner.github.io/project'), 'http://owner.github.io/project');
assert(!prompt.isGitHub('http://www.example.org'), 'http://www.example.org');
});
download({}, function (err, d, url, ver) {
assert(!err, err);
assert.deepEqual(ver, {tag_name: 'v2.5.2'});
assert.equal(url, download.WSK_ZIP_URL + 'v2.5.2.zip');
assert(d);
if (!scope.isDone()) {
assert.fail('pending mocks: ' + scope.pendingMocks());
}
done();
});
});
download({}, function (err) {
assert(err);
assert.equal(err.toString(), 'Error: bad request');
done();
});
});