Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}});
model.beforeSelect = function(opt) {
t.deepEqual(opt, options);
return opt;
};
model.afterSelect = function(selectData, opt) {
t.deepEqual(selectData, data);
t.deepEqual(opt, options);
return selectData;
};
const result = await model.where({id: ['>', 10]}).select();
t.deepEqual(result, data);
});
test.todo('selectAdd');
test.todo('countSelect');
test('model get field normal', async t => {
t.plan(2);
const model = new Model('post', {handle: class {
select(options) {
t.deepEqual(options, {
pk: 'id',
table: 'post',
tablePrefix: '',
field: 'content, title'
});
return [
t.deepEqual(mockChildProc.spawns[0].args, ['test.js', '1', '2']);
t.is(exitCode, 99);
});
test('Run - not found', t => {
t.throws(() => {
nvsUse.run(
new NodeVersion('test', '5.6.7', 'x64'),
['test.js', '1', '2']);
}, error => {
return error.code === 'ENOENT';
});
});
test.todo('Exec');
test.todo('Exec - not found');
model.beforeSelect = function(opt) {
t.deepEqual(opt, options);
return opt;
};
model.afterSelect = function(selectData, opt) {
t.deepEqual(selectData, data);
t.deepEqual(opt, options);
return selectData;
};
const result = await model.where({id: ['>', 10]}).select();
t.deepEqual(result, data);
});
test.todo('selectAdd');
test.todo('countSelect');
test('model get field normal', async t => {
t.plan(2);
const model = new Model('post', {handle: class {
select(options) {
t.deepEqual(options, {
pk: 'id',
table: 'post',
tablePrefix: '',
field: 'content, title'
});
return [
{title: 'hello1', content: 'world1'},
{title: 'hello2', content: 'world2'}
t.is(mockChildProc.spawns[0].exe, binPath.replace(/\//g, path.sep));
t.deepEqual(mockChildProc.spawns[0].args, ['test.js', '1', '2']);
t.is(exitCode, 99);
});
test('Run - not found', t => {
t.throws(() => {
nvsUse.run(
new NodeVersion('test', '5.6.7', 'x64'),
['test.js', '1', '2']);
}, error => {
return error.code === 'ENOENT';
});
});
test.todo('Exec');
test.todo('Exec - not found');
],
js: [
'fake.js',
'fake2.js'
]
};
const wrapper = shallow();
t.is(wrapper.find('head').length, 1);
t.is(wrapper.find('meta').length, 1);
t.is(wrapper.find('meta').props().charSet, 'utf-8');
t.is(wrapper.find('link').length, fakeAssets.css.length);
t.is(wrapper.find('script').length, fakeAssets.js.length);
});
test.todo(' with missing assets');
const test = require('ava').test;
test.before(require('./checkNodeVersion'));
test.todo('List available - single remote');
test.todo('List available - all remotes');
test.todo('List available - index not found');
];
t.is(wrapper.find('thead').length, 1);
t.is(wrapper.find('tr').length, 1);
t.is(wrapper.find('th').length, expectedKeys.length);
const shallowWrapper = shallow();
let i = 0;
for (const expectedKey of expectedKeys) {
t.is(shallowWrapper.find('th').at(i).key(), expectedKey);
i++;
}
});
test.todo(' with missing props');
mockFs.mockFile(testSystemHome + 'test/5.6.7/x64/bin/node');
mockFs.mockDir('/usr/local/bin', ['node']);
mockFs.mockLink(testSystemHome + 'default', 'test/5.6.7/x64');
mockFs.mockLink('/usr/local/bin/node', '../nvs/test/5.6.7/x64/bin/node');
mockFs.mockLink('/usr/local/lib/node_modules', '../nvs/test/5.6.7/x64/lib/node_modules');
nvsLink.unlink(null);
t.falsy(mockFs.linkMap[testSystemHome + 'default']);
t.falsy(mockFs.linkMap[mockFs.fixSep('/usr/local/bin/node')]);
t.falsy(mockFs.linkMap[mockFs.fixSep('/usr/local/lib/node_modules')]);
});
test.todo('Unlink - when system node is present');
test.todo('Get version from PATH - system linked');
const test = require('ava').test;
test.before(require('./checkNodeVersion'));
test.todo('List available - single remote');
test.todo('List available - all remotes');
test.todo('List available - index not found');
mockFs.mockDir(testSystemHome + 'test/5.6.7/x64/lib/node_modules', []);
mockFs.mockFile(testSystemHome + 'test/5.6.7/x64/bin/node');
mockFs.mockDir('/usr/local/bin', ['node']);
mockFs.mockLink(testSystemHome + 'default', 'test/5.6.7/x64');
mockFs.mockLink('/usr/local/bin/node', '../nvs/test/5.6.7/x64/bin/node');
mockFs.mockLink('/usr/local/lib/node_modules', '../nvs/test/5.6.7/x64/lib/node_modules');
nvsLink.unlink(null);
t.falsy(mockFs.linkMap[testSystemHome + 'default']);
t.falsy(mockFs.linkMap[mockFs.fixSep('/usr/local/bin/node')]);
t.falsy(mockFs.linkMap[mockFs.fixSep('/usr/local/lib/node_modules')]);
});
test.todo('Unlink - when system node is present');
test.todo('Get version from PATH - system linked');