Skip to content

Commit

Permalink
Merge pull request #9 from jongear/testing/add-automation
Browse files Browse the repository at this point in the history
Testing/add automation
  • Loading branch information
jongear authored May 29, 2019
2 parents 322f886 + 39ddb1d commit 6a30309
Show file tree
Hide file tree
Showing 9 changed files with 4,412 additions and 659 deletions.
37 changes: 37 additions & 0 deletions .eslintrc
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
}
}
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ results

npm-debug.log

build/
node_modules/
build
node_modules

coverage

.vscode/ipch
15 changes: 11 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@ matrix:
# OS X #
########

- name: '[OSX] 10.13 Node.js v6.x'
- name: '[OSX] macOS 10.13 — Xcode 9.3 — Node.js v6.x'
os: osx
osx_image: xcode9.3
node_js: '6'

- name: '[OSX] 10.13 Node.js v8.x'
- name: '[OSX] macOS 10.13 — Xcode 9.3 — Node.js v8.x'
os: osx
osx_image: xcode9.3
node_js: '8'

- name: '[OSX] 10.13 Node.js v10.x xcode 9.3'
- name: '[OSX] macOS 10.13 — Xcode 9.3 — Node.js v10.x'
os: osx
osx_image: xcode9.3
node_js: '10'

- name: '[OSX] 10.13 Node.js v10.x xcode10'
- name: '[OSX] macOS 10.13 — Xcode 10 — Node.js v10.x'
os: osx
osx_image: xcode10
node_js: '10'

- name: '[OSX] macOS 10.14 — Xcode 10.2.1 — Node.js v10.x'
os: osx
osx_image: xcode10.2
node_js: '10'
after_success:
- 'echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config'
- semantic-release
Expand All @@ -42,4 +47,6 @@ install:
- npm install

script:
- npm run lint
- npm run report-coverage
- npm run build
30 changes: 30 additions & 0 deletions index.spec.js
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);
});
Loading

0 comments on commit 6a30309

Please sign in to comment.