Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(async function mockValidProjectLayout(done) {
mockFs({
'path/to/testsuites': {
'sakuli.properties': `
sakuli.environment.similarity.default=0.99
`,
'suite': {
'testsuite.properties': `testsuite.name=test`,
'testsuite.suite': stripIndent`
case1/sakuli_demo.js http://sahi.example.com/_s_/dyn/Driver_initialized
case2/sakuli_demo.js http://sahi.example.com/_s_/dyn/Driver_initialized
`,
case1: {
'sakuli_demo.js': '// Test'
},
case2: {
'sakuli_demo.js': '// Test'
}
export function initWithoutTree(){
mock(filesWithoutTree);
}
export function initEmpty(){
mock(filesEmpty);
}
export function initWithErrorTree() {
mock(filesWithErrorTree);
}
function mockFs() {
mock({
[testDir]: {
[showFolder]: mock.directory({
birthtime: pastDate,
items: {
[showFile1]: f(pastDate),
[showFile2]: f(pastDate),
[showFile3]: f(pastDate),
[showFile4]: f(pastDate)
}
}),
[movieFolder]: mock.directory({
birthtime: nearestDate,
items: {
[movieFile]: f(nearestDate)
}
})
export function initWithTree(){
mock(filesWithTree);
}
export function mockFsWithCwd(config, cwd) {
mockFs(config, {
createCwd: false
});
process.chdir(cwd);
}
beforeEach(done => {
mockFS(mockFileSystem);
done();
});
export function initWithoutTree(){
mock(filesWithoutTree);
}
before(function() {
mockfs(mockTree);
this.spawn = childProcess.spawn;
});