-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(index.spec.js): Added first real automated test of the toolsuite
Added first jest backed test of the xpc-connect test suite. The purpose of this test is to validate that the library is able to bind to the XPS Services Connection API exposed by Apple in each version of Node and Xcode.
- Loading branch information
Showing
6 changed files
with
4,381 additions
and
655 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"rules": { | ||
"max-len": 0, | ||
"comma-dangle": 0, | ||
"no-console": 0, | ||
"padded-blocks": 0, | ||
"indent": [ | ||
2, | ||
2, | ||
{ | ||
"SwitchCase": 1 | ||
} | ||
], | ||
"spaced-comment": 1, | ||
"quotes": [ | ||
"error", | ||
"single", | ||
{ | ||
"allowTemplateLiterals": true | ||
} | ||
], | ||
"import/prefer-default-export": "off", | ||
"arrow-parens": 0, | ||
"consistent-return": 0, | ||
"no-useless-escape": 0, | ||
"no-underscore-dangle": 0, | ||
"no-undef": "error" | ||
}, | ||
"extends": ["prettier"], | ||
"plugins": ["prettier"], | ||
"env": { | ||
"browser": false, | ||
"node": true, | ||
"es6": true, | ||
"jest": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,9 @@ results | |
|
||
npm-debug.log | ||
|
||
build/ | ||
node_modules/ | ||
build | ||
node_modules | ||
|
||
coverage | ||
|
||
.vscode/ipch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const xpcConnect = require('./index'); | ||
|
||
test('test bluetooth connectivity', done => { | ||
let bluedService = new xpcConnect('com.apple.blued'); | ||
|
||
|
||
bluedService.on('error', function(message) { | ||
console.log('error: ' + JSON.stringify(message, undefined, 2)); | ||
}); | ||
|
||
|
||
bluedService.on('event', function(event) { | ||
console.log('event: ' + JSON.stringify(event, undefined, 2)); | ||
}); | ||
|
||
bluedService.setup(); | ||
|
||
bluedService.sendMessage({ | ||
kCBMsgId: 1, | ||
kCBMsgArgs: { | ||
kCBMsgArgAlert: 1, | ||
kCBMsgArgName: 'node' | ||
} | ||
}); | ||
|
||
setTimeout(function() { | ||
bluedService.shutdown(); | ||
done(); | ||
}, 500); | ||
}); |
Oops, something went wrong.