Browse Source

Update tests

tags/v3.6.0
Samuel Attard 3 years ago
parent
commit
850519114c
No account linked to committer's email address
5 changed files with 36 additions and 36 deletions
  1. 2
    2
      .travis.yml
  2. 2
    2
      circle.yml
  3. 2
    2
      docker-compose.yml
  4. 4
    4
      package.json
  5. 26
    26
      test/electron/webSocketAPI_spec.js

+ 2
- 2
.travis.yml View File

@@ -22,8 +22,8 @@ script:
- npm run test
- if [[ $TRAVIS_PULL_REQUEST == "false" ]]; then ./sig/import.sh && npm run make:darwin && node ./sig/publish-mac.js; fi
- if [[ $TRAVIS_PULL_REQUEST != "false" ]]; then npm run package:darwin; fi
- npm run test-unit
- npm run test-spec
- npm run test-electron
- npm run test-spectron

notifications:
webhooks:

+ 2
- 2
circle.yml View File

@@ -34,8 +34,8 @@ test:
parallel: true
- case $CIRCLE_NODE_INDEX in 0) npm run make:deb:32 ;; 1) npm run make:deb:64 ;; 2) npm run make:rpm:32 ;; 3) npm run make:rpm:64 ;; esac:
parallel: true
- npm run test-unit
- case $CIRCLE_NODE_INDEX in 0) npm -v ;; 1) npm run test-spec ;; 2) npm -v ;; 3) npm run test-spec ;; esac:
- npm run test-electron
- case $CIRCLE_NODE_INDEX in 0) npm -v ;; 1) npm run test-spectron ;; 2) npm -v ;; 3) npm run test-spectron ;; esac:
parallel: true

general:

+ 2
- 2
docker-compose.yml View File

@@ -3,7 +3,7 @@ version: '2'
services:
test-runner:
build: .
command: npm run test-unit
command: npm run test-electron
volumes:
- .:/test-output
environment:
@@ -11,7 +11,7 @@ services:

spec-runner:
build: .
command: npm run test-spec
command: npm run test-spectron
volumes:
- .:/test-output
environment:

+ 4
- 4
package.json View File

@@ -25,10 +25,10 @@
"package:win": "gulp package:win",
"postinstall": "node vendor/rebuild.js --instant",
"test": "npm run lint",
"pretest-unit": "npm run build",
"pretest-spec": "npm run build",
"test-unit": "electron-mocha ./test/electron --recursive --compilers js:babel-core/register --timeout 10000 -R spec-xunit-file",
"test-spec": "mocha ./test/spectron --compilers js:babel-core/register -R spec-xunit-file --timeout 10000",
"pretest-electron": "npm run build",
"pretest-spectron": "npm run build",
"test-electron": "electron-mocha ./test/electron --recursive --compilers js:babel-core/register --timeout 10000 -R spec-xunit-file",
"test-spectron": "mocha ./test/spectron --compilers js:babel-core/register -R spec-xunit-file --timeout 10000",
"prestart": "pre-flight && node vendor/mac_patch_dev.js",
"start": "electron . --dev",
"watch": "gulp watch"

+ 26
- 26
test/electron/webSocketAPI_spec.js View File

@@ -81,13 +81,13 @@ describe('WebSocketAPI', () => {
spy.getCall(1).args[0].channel.should.be.equal('playState');
spy.getCall(2).args[0].channel.should.be.equal('shuffle');
spy.getCall(3).args[0].channel.should.be.equal('repeat');
spy.getCall(4).args[0].channel.should.be.equal('playlists');
spy.getCall(5).args[0].channel.should.be.equal('queue');
spy.getCall(6).args[0].channel.should.be.equal('search-results');
spy.getCall(7).args[0].channel.should.be.equal('library');
spy.getCall(8).args[0].channel.should.be.equal('track');
spy.getCall(9).args[0].channel.should.be.equal('time');
spy.getCall(10).args[0].channel.should.be.equal('lyrics');
spy.getCall(4).args[0].channel.should.be.equal('queue');
spy.getCall(5).args[0].channel.should.be.equal('search-results');
spy.getCall(6).args[0].channel.should.be.equal('track');
spy.getCall(7).args[0].channel.should.be.equal('time');
spy.getCall(8).args[0].channel.should.be.equal('lyrics');
spy.getCall(9).args[0].channel.should.be.equal('playlists');
spy.getCall(10).args[0].channel.should.be.equal('library');
done();
}));

@@ -99,37 +99,37 @@ describe('WebSocketAPI', () => {
spy.getCall(2).args[0].payload.should.be.equal('NO_SHUFFLE');
// repeat
spy.getCall(3).args[0].payload.should.be.equal('NO_REPEAT');
// playlists
spy.getCall(4).args[0].payload.should.be.deep.equal([]);
// queue
spy.getCall(5).args[0].payload.should.be.deep.equal([]);
spy.getCall(4).args[0].payload.should.be.deep.equal([]);
// search-results
spy.getCall(6).args[0].payload.should.be.deep.equal({
spy.getCall(5).args[0].payload.should.be.deep.equal({
searchText: '',
albums: [],
artists: [],
tracks: [],
});
// track
spy.getCall(6).args[0].payload.should.have.property('title');
spy.getCall(6).args[0].payload.should.have.property('artist');
spy.getCall(6).args[0].payload.should.have.property('album');
expect(spy.getCall(6).args[0].payload.title).to.be.equal(null);
expect(spy.getCall(6).args[0].payload.artist).to.be.equal(null);
expect(spy.getCall(6).args[0].payload.album).to.be.equal(null);
// time
spy.getCall(7).args[0].payload.should.have.property('current');
spy.getCall(7).args[0].payload.should.have.property('total');
spy.getCall(7).args[0].payload.current.should.be.equal(0);
spy.getCall(7).args[0].payload.total.should.be.equal(0);
// lyrics
expect(spy.getCall(8).args[0].payload).to.be.equal(null);
// playlists
spy.getCall(9).args[0].payload.should.be.deep.equal([]);
// library
spy.getCall(7).args[0].payload.should.be.deep.equal({
spy.getCall(10).args[0].payload.should.be.deep.equal({
albums: [],
artists: [],
tracks: [],
});
// track
spy.getCall(8).args[0].payload.should.have.property('title');
spy.getCall(8).args[0].payload.should.have.property('artist');
spy.getCall(8).args[0].payload.should.have.property('album');
expect(spy.getCall(8).args[0].payload.title).to.be.equal(null);
expect(spy.getCall(8).args[0].payload.artist).to.be.equal(null);
expect(spy.getCall(8).args[0].payload.album).to.be.equal(null);
// time
spy.getCall(9).args[0].payload.should.have.property('current');
spy.getCall(9).args[0].payload.should.have.property('total');
spy.getCall(9).args[0].payload.current.should.be.equal(0);
spy.getCall(9).args[0].payload.total.should.be.equal(0);
// lyrics
expect(spy.getCall(10).args[0].payload).to.be.equal(null);
done();
}));


Loading…
Cancel
Save