mirror of
https://github.com/wled/WLED.git
synced 2025-07-24 19:26:40 +00:00
add new test
This commit is contained in:
parent
04c3a925cc
commit
e0f987328b
@ -171,5 +171,24 @@ describe('General functionality', () => {
|
|||||||
const currentTime = Date.now();
|
const currentTime = Date.now();
|
||||||
assert(currentTime - modifiedTime < 500, 'html_ui.h was not modified');
|
assert(currentTime - modifiedTime < 500, 'html_ui.h was not modified');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should rebuild if a inlined file changes', async () => {
|
||||||
|
// run script cdata.js and wait for it to finish
|
||||||
|
await execPromise('node tools/cdata.js');
|
||||||
|
|
||||||
|
// modify index.htm
|
||||||
|
fs.appendFileSync(path.join(dataPath, 'index.js'), ' ');
|
||||||
|
// delay for 1 second to ensure the modified time is different
|
||||||
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
||||||
|
|
||||||
|
// run script cdata.js and wait for it to finish
|
||||||
|
await execPromise('node tools/cdata.js');
|
||||||
|
|
||||||
|
// check if html_ui.h was modified
|
||||||
|
const stats = fs.statSync(path.join(folderPath, 'html_ui.h'));
|
||||||
|
const modifiedTime = stats.mtimeMs;
|
||||||
|
const currentTime = Date.now();
|
||||||
|
assert(currentTime - modifiedTime < 500, 'html_ui.h was not modified');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user