mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
Update test
This commit is contained in:
1 parent
d919471838
commit
3d32d51aeb
2 files changed
+408
-634
No files matched your search
+31
-4
@@ -35,16 +35,43 @@ describe('Document', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function testAll(art, done) {
|
||||||
|
let isDone = false;
|
||||||
|
art.on('ready', () => {
|
||||||
|
expect(art.id).to.be.an('number');
|
||||||
|
|
||||||
|
if (!isDone) {
|
||||||
|
isDone = true;
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
art.on('video:error', () => {
|
||||||
|
expect(art.id).to.be.an('number');
|
||||||
|
|
||||||
|
if (!isDone) {
|
||||||
|
isDone = true;
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
expect(art.id).to.be.an('number');
|
||||||
|
|
||||||
|
if (!isDone) {
|
||||||
|
isDone = true;
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
${htmls
|
${htmls
|
||||||
.map((item, index) => {
|
.map((item, index) => {
|
||||||
return `
|
return `
|
||||||
it('Test${index}', function(done) {
|
it('Test${index}', function(done) {
|
||||||
${item}
|
${item}
|
||||||
|
|
||||||
setTimeout(() => {
|
testAll(art, done);
|
||||||
expect(art.id).to.be.an('number');
|
|
||||||
done();
|
|
||||||
}, 1000);
|
|
||||||
});`;
|
});`;
|
||||||
})
|
})
|
||||||
.join('\n\n')}
|
.join('\n\n')}
|
||||||
|
|||||||
+377
-630
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user