-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.js
More file actions
37 lines (26 loc) · 801 Bytes
/
tests.js
File metadata and controls
37 lines (26 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const testing = require('testing');
const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const fs = require('fs');
const path = require('path');
function testCreate( callback ){
try{
const js = fs.readFileSync(path.resolve(__dirname, './public/linesnumber.min.js'), 'utf8');
const dom = new JSDOM("<!DOCTYPE html><head></head><html><body><div><textarea id='test'></textarea></div><script>\
"+js+"\
document.getElementById('test').LinesNumber();\
</script>\
</body></html>");
return testing.success(callback);
}
catch(ex){
console.log(ex)
}
testing.failure("Lib error", callback);
}
testing.run([
testCreate
], function(e){
console.log(e)
return true
});