update .prettierignore

This commit is contained in:
Harvey Zack committed 2022-11-04 23:05:13 +08:00
1 parent 463884b50a
commit 7912559c17
5 files changed
+2609 -2615

No files matched your search

-4
View File
@@ -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
+5 -5
View File
@@ -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
View File
File diff suppressed because it is too large. Load diff
+47 -49
View File
@@ -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 { <body>
display: flex; <div class="artplayer-app">
justify-content: center; <div class="sample1">sample1</div>
align-items: center; <div class="sample2">sample2</div>
flex: 1; <div class="sample3">sample3</div>
padding: 10px; </div>
border-right: 1px solid #999; <div id="mocha"></div>
} <script>
</style> window.mocha.setup('bdd');
</head> window.expect = window.chai.expect;
</script>
<body> <script src="../packages/artplayer/dist/artplayer.js"></script>
<div class="artplayer-app"> <script src="../packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js"></script>
<div class="sample1">sample1</div> <script src="../packages/artplayer-plugin-ads/dist/artplayer-plugin-ads.js"></script>
<div class="sample2">sample2</div> <script src="../packages/artplayer-plugin-iframe/dist/artplayer-helper-iframe.js"></script>
<div class="sample3">sample3</div> <!-- Test start -->
</div> <script src="./document.test.js"></script>
<div id="mocha"></div> <script src="./option.test.js"></script>
<script> <!-- Test end -->
window.mocha.setup('bdd'); <script>
window.expect = window.chai.expect; mocha.checkLeaks();
</script> mocha.run();
<script src="../packages/artplayer/dist/artplayer.js"></script> </script>
<script src="../packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js"></script> </body>
<script src="../packages/artplayer-plugin-ads/dist/artplayer-plugin-ads.js"></script> </html>
<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>
+7 -7
View File
@@ -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,