Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('arduino should load and unload arduino latest', async t => {
const arduinoObj = arduino({path: 'tmp', tag: 'load'});
let err = await pify(arduinoObj.load)();
t.is(err, undefined);
const bin = await pify(arduinoObj.binary)();
const exec = await executable(bin);
t.is(exec, true);
err = await pify(arduinoObj.unload)();
t.is(err, undefined);
const result = await exists(bin);
t.is(result, false);
});
async function isExecutableScript(path, recognizer) {
if (isExtensionless(path) && await executable(path)) {
let contents = await readFile(path);
let firstLine = contents.toString().split('\n')[0];
if (firstLine.startsWith('#!') && firstLine.includes(recognizer.shebangSuffix)) {
return true;
}
}
return false;
}