New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add tests #8
Conversation
package.json
Outdated
@@ -4,7 +4,7 @@ | |||
"description": "Node.js implementation for the MPRIS D-Bus Interface Specification to create a mediaplayer service", | |||
"main": "index.js", | |||
"scripts": { | |||
"test": "echo \"Error: no test specified\" && exit 1" | |||
"test": "./node_modules/.bin/jasmine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just write jasmine
, NPM will expand it to node_modules/.bin/jasmine
automatically.
Looks very good! We can also get rid of all the ugly Also, in the tests what happens if |
Some questions:
|
Yes |
I think just targeting LTS will be fine. This module was written a long time ago, and needs ES6.
I think this can work. Will try to do it. |
.travis.yml
Outdated
apt: | ||
packages: | ||
- gcc-4.8 | ||
- g++-4.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this needs everything from https://github.com/Shouqun/node-dbus#dependencies plus libexpat1-dev
Comment got hidden:
|
Note: if we want to rollback to precise on travis, we need:
env:
- CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
- g++-5 |
Yay! The build now works :D |
spec/helpers/helpers.js
Outdated
}, | ||
waitForEvent: (player, event) => { | ||
return new Promise((resolve) => { | ||
player.on(event, resolve); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use .once()
here to do not end up with a large number of listeners.
TBH, I don't like using Symbol. How about just making them classes and using them like so: this.interfaces = {
root: new RootInterface()
};
if (this.supportedInterfaces.includes('player')) {
this.interfaces.player = new PlayerInterface();
}
if (this.supportedInterfaces.include('trackList')) {
this.interfaces.trackList = new TrackListInterface();
}
if (this.supportedInterfaces.include('playlists')) {
this.interfaces.playlists = new PlaylistsInterface();
} |
spec/player-interface-spec.js
Outdated
|
||
return promise.then(() => { | ||
|
||
return helpers.getInterfaceAsync(service, objectpath, 'org.mpris.MediaPlayer2.Player').then(obj => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to get the interface outside the reduce
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, will take a look
@emersion any news here? |
This reverts commit da7db6d.
Rebased all commits (but I should have just merged, too late :( ) with the latest fix in master. I get this:
|
You might want to show up in gitter :) |
Superseded by #15 |
I thought it would be nice to start a PR right away, so we can discuss everything as we go.
Some notes:
Feel free to leave a comment or commit some stuff as I will squash everything at the end.
Fixes #7