mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 19:41:25 -08:00
update .prettierignore
This commit is contained in:
1 parent
463884b50a
commit
7912559c17
5 files changed
+2608
-2614
No files matched your search
@@ -2,11 +2,7 @@ node_modules
|
|||||||
.docusaurus
|
.docusaurus
|
||||||
.parcel-cache
|
.parcel-cache
|
||||||
.github
|
.github
|
||||||
*.log
|
|
||||||
*.lock
|
|
||||||
test
|
|
||||||
docs
|
docs
|
||||||
scripts
|
|
||||||
packages/*/dist
|
packages/*/dist
|
||||||
packages/*/node_modules
|
packages/*/node_modules
|
||||||
packages/*/.parcel-cache
|
packages/*/.parcel-cache
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
describe('Constructor', function() {
|
describe('Constructor', function () {
|
||||||
var url = './assets/sample/video.mp4';
|
var url = './assets/sample/video.mp4';
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function () {
|
||||||
[...Artplayer.instances].forEach(art => {
|
[...Artplayer.instances].forEach((art) => {
|
||||||
art.destroy(true);
|
art.destroy(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Constructor is a global variable', function() {
|
it('Constructor is a global variable', function () {
|
||||||
expect(Artplayer).to.be.an('function');
|
expect(Artplayer).to.be.an('function');
|
||||||
expect(Artplayer.instances).to.be.an('array');
|
expect(Artplayer.instances).to.be.an('array');
|
||||||
expect(Artplayer.instances.length).to.be.equal(0);
|
expect(Artplayer.instances.length).to.be.equal(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Instance state', function() {
|
it('Instance state', function () {
|
||||||
var sample1 = new Artplayer({ container: '.sample1', url: url });
|
var sample1 = new Artplayer({ container: '.sample1', url: url });
|
||||||
expect(sample1.id).to.equal(1);
|
expect(sample1.id).to.equal(1);
|
||||||
var sample2 = new Artplayer({ container: '.sample2', url: url });
|
var sample2 = new Artplayer({ container: '.sample2', url: url });
|
||||||
|
|||||||
+2550
-2550
File diff suppressed because it is too large.
Load diff
+46
-48
@@ -1,52 +1,50 @@
|
|||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Mocha Tests</title>
|
||||||
|
<link href="../node_modules/mocha/mocha.css" rel="stylesheet" />
|
||||||
|
<script src="../node_modules/chai/chai.js"></script>
|
||||||
|
<script src="../node_modules/mocha/mocha.js"></script>
|
||||||
|
<style>
|
||||||
|
.artplayer-app {
|
||||||
|
display: flex;
|
||||||
|
height: 300px;
|
||||||
|
border-bottom: 1px solid #999;
|
||||||
|
}
|
||||||
|
|
||||||
<head>
|
.artplayer-app > div {
|
||||||
<meta charset="utf-8" />
|
display: flex;
|
||||||
<title>Mocha Tests</title>
|
justify-content: center;
|
||||||
<link href="../node_modules/mocha/mocha.css" rel="stylesheet" />
|
align-items: center;
|
||||||
<script src="../node_modules/chai/chai.js"></script>
|
flex: 1;
|
||||||
<script src="../node_modules/mocha/mocha.js"></script>
|
padding: 10px;
|
||||||
<style>
|
border-right: 1px solid #999;
|
||||||
.artplayer-app {
|
}
|
||||||
display: flex;
|
</style>
|
||||||
height: 300px;
|
</head>
|
||||||
border-bottom: 1px solid #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.artplayer-app>div {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
flex: 1;
|
|
||||||
padding: 10px;
|
|
||||||
border-right: 1px solid #999;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="artplayer-app">
|
|
||||||
<div class="sample1">sample1</div>
|
|
||||||
<div class="sample2">sample2</div>
|
|
||||||
<div class="sample3">sample3</div>
|
|
||||||
</div>
|
|
||||||
<div id="mocha"></div>
|
|
||||||
<script>
|
|
||||||
window.mocha.setup('bdd');
|
|
||||||
window.expect = window.chai.expect;
|
|
||||||
</script>
|
|
||||||
<script src="../packages/artplayer/dist/artplayer.js"></script>
|
|
||||||
<script src="../packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js"></script>
|
|
||||||
<script src="../packages/artplayer-plugin-ads/dist/artplayer-plugin-ads.js"></script>
|
|
||||||
<script src="../packages/artplayer-plugin-iframe/dist/artplayer-helper-iframe.js"></script>
|
|
||||||
<!-- Test start -->
|
|
||||||
<script src="./document.test.js"></script>
|
|
||||||
<script src="./option.test.js"></script>
|
|
||||||
<!-- Test end -->
|
|
||||||
<script>
|
|
||||||
mocha.checkLeaks();
|
|
||||||
mocha.run();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="artplayer-app">
|
||||||
|
<div class="sample1">sample1</div>
|
||||||
|
<div class="sample2">sample2</div>
|
||||||
|
<div class="sample3">sample3</div>
|
||||||
|
</div>
|
||||||
|
<div id="mocha"></div>
|
||||||
|
<script>
|
||||||
|
window.mocha.setup('bdd');
|
||||||
|
window.expect = window.chai.expect;
|
||||||
|
</script>
|
||||||
|
<script src="../packages/artplayer/dist/artplayer.js"></script>
|
||||||
|
<script src="../packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js"></script>
|
||||||
|
<script src="../packages/artplayer-plugin-ads/dist/artplayer-plugin-ads.js"></script>
|
||||||
|
<script src="../packages/artplayer-plugin-iframe/dist/artplayer-helper-iframe.js"></script>
|
||||||
|
<!-- Test start -->
|
||||||
|
<script src="./document.test.js"></script>
|
||||||
|
<script src="./option.test.js"></script>
|
||||||
|
<!-- Test end -->
|
||||||
|
<script>
|
||||||
|
mocha.checkLeaks();
|
||||||
|
mocha.run();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+7
-7
@@ -1,21 +1,21 @@
|
|||||||
describe('Option', function() {
|
describe('Option', function () {
|
||||||
var url = './assets/sample/video.mp4';
|
var url = './assets/sample/video.mp4';
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function () {
|
||||||
[...Artplayer.instances].forEach(art => {
|
[...Artplayer.instances].forEach((art) => {
|
||||||
art.destroy(true);
|
art.destroy(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Throw error when multiple instances on the same dom element', function() {
|
it('Throw error when multiple instances on the same dom element', function () {
|
||||||
expect(function() {
|
expect(function () {
|
||||||
new Artplayer({ container: '.sample1', url: url });
|
new Artplayer({ container: '.sample1', url: url });
|
||||||
new Artplayer({ container: '.sample1', url: url });
|
new Artplayer({ container: '.sample1', url: url });
|
||||||
}).to.throw(/Cannot mount multiple instances on the same dom element/);
|
}).to.throw(/Cannot mount multiple instances on the same dom element/);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Throw error when container is not a dom element or selector', function() {
|
it('Throw error when container is not a dom element or selector', function () {
|
||||||
expect(function() {
|
expect(function () {
|
||||||
new Artplayer({
|
new Artplayer({
|
||||||
container: null,
|
container: null,
|
||||||
url: url,
|
url: url,
|
||||||
|
|||||||
Reference in new issue
Block a user