|
|
@ -1,10 +1,10 @@
|
|
|
|
const fs = require('fs');
|
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
const path = require('path');
|
|
|
|
const child_process = require('child_process');
|
|
|
|
|
|
|
|
const assert = require('assert');
|
|
|
|
const assert = require('assert');
|
|
|
|
const glob = require('tiny-glob/sync.js');
|
|
|
|
const glob = require('tiny-glob/sync.js');
|
|
|
|
|
|
|
|
const shell = require("shelljs");
|
|
|
|
|
|
|
|
|
|
|
|
const bin = path.resolve(`svelte`);
|
|
|
|
const cli = path.resolve(__dirname, "../../cli/index.ts.js");
|
|
|
|
|
|
|
|
|
|
|
|
function normalize(str) {
|
|
|
|
function normalize(str) {
|
|
|
|
return str
|
|
|
|
return str
|
|
|
@ -31,14 +31,12 @@ describe('cli', () => {
|
|
|
|
|
|
|
|
|
|
|
|
const command = fs.readFileSync('command.sh', 'utf-8');
|
|
|
|
const command = fs.readFileSync('command.sh', 'utf-8');
|
|
|
|
|
|
|
|
|
|
|
|
child_process.exec(`
|
|
|
|
shell.mkdir("-p", "actual");
|
|
|
|
alias svelte=${bin}
|
|
|
|
shell.rm("-rf", "actual/*");
|
|
|
|
mkdir -p actual
|
|
|
|
const { commandErr } = shell.exec(`node ${cli} ${command}`);
|
|
|
|
rm -rf actual/*
|
|
|
|
|
|
|
|
${command}
|
|
|
|
if (commandErr) {
|
|
|
|
`, (err, stdout, stderr) => {
|
|
|
|
done(commandErr);
|
|
|
|
if (err) {
|
|
|
|
|
|
|
|
done(err);
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -73,7 +71,7 @@ describe('cli', () => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
done();
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|