mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-07-10 21:46:09 +08:00
✨ 初始化项目 🎉
This commit is contained in:
43
tests/unit/electron.spec.js
Normal file
43
tests/unit/electron.spec.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import testWithSpectron from 'vue-cli-plugin-electron-builder/lib/testWithSpectron'
|
||||
import chai from 'chai'
|
||||
import chaiAsPromised from 'chai-as-promised'
|
||||
// eslint-disable-next-line no-undef
|
||||
const spectron = __non_webpack_require__('spectron')
|
||||
|
||||
chai.should()
|
||||
chai.use(chaiAsPromised)
|
||||
|
||||
describe('Application launch', function () {
|
||||
this.timeout(30000)
|
||||
|
||||
beforeEach(function () {
|
||||
return testWithSpectron(spectron).then(instance => {
|
||||
this.app = instance.app
|
||||
this.stopServe = instance.stopServe
|
||||
})
|
||||
})
|
||||
|
||||
beforeEach(function () {
|
||||
chaiAsPromised.transferPromiseness = this.app.transferPromiseness
|
||||
})
|
||||
|
||||
afterEach(function () {
|
||||
if (this.app && this.app.isRunning()) {
|
||||
return this.stopServe()
|
||||
}
|
||||
})
|
||||
|
||||
it('opens a window', function () {
|
||||
return this.app.client
|
||||
.getWindowCount()
|
||||
.should.eventually.have.at.least(1)
|
||||
.browserWindow.isMinimized()
|
||||
.should.eventually.be.false.browserWindow.isVisible()
|
||||
.should.eventually.be.true.browserWindow.getBounds()
|
||||
.should.eventually.have.property('width')
|
||||
.and.be.above(0)
|
||||
.browserWindow.getBounds()
|
||||
.should.eventually.have.property('height')
|
||||
.and.be.above(0)
|
||||
})
|
||||
})
|
||||
13
tests/unit/example.spec.js
Normal file
13
tests/unit/example.spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import { expect } from 'chai'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import HelloWorld from '@/components/HelloWorld.vue'
|
||||
|
||||
describe('HelloWorld.vue', () => {
|
||||
it('renders props.msg when passed', () => {
|
||||
const msg = 'new message'
|
||||
const wrapper = shallowMount(HelloWorld, {
|
||||
props: { msg }
|
||||
})
|
||||
expect(wrapper.text()).to.include(msg)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user