提交 a64e7c07 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix tests

上级 4aafd10a
......@@ -27,11 +27,11 @@ install:
- if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew update; brew cleanup; brew cask cleanup; fi
- if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew uninstall --force brew-cask; brew update; fi
- if [ "$TRAVIS_OS_NAME" == 'osx' ]; then brew cask install --force google-chrome; fi
- if [ "$TRAVIS_OS_NAME" == 'osx' ]; then npm install; fi
- if [ "$TRAVIS_OS_NAME" == 'linux' ]; then export DISPLAY=':99.0'; fi
- if [ "$TRAVIS_OS_NAME" == 'linux' ]; then (Xvfb :99 -screen 0 640x480x8 > /dev/null 2>&1 &); fi
# - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then export DISPLAY=':99.0'; fi
# - if [ "$TRAVIS_OS_NAME" == 'linux' ]; then (Xvfb :99 -screen 0 640x480x8 > /dev/null 2>&1 &); fi
- npm install
- echo $TRAVIS_OS_NAME
script:
......
......@@ -772,6 +772,7 @@ npm test
1. [#41](https://github.com/wechaty/wechaty/issues/41) Sayablization: Make Wechaty/Contact/Room `Sayable`, and all `this` inside wechaty event listeners are `Sayable` too.
1. BREAKING CHANGE: global event `scan` listener arguments changed from 1 to 2: now is `function(this: Sayable, url: string, code: number)` instead of `function({url, code})` before.
1. add `npm run doctor` to diagnose wechaty and output useful debug information
1. test under Node.js v7.0
## [v0.4.0](https://github.com/wechaty/wechaty/releases/tag/v0.4.0) (2016/10/9) The Latest Javascript Version
1. [#32](https://github.com/wechaty/wechaty/issues/32) Extend Room Class with:
......
......@@ -4,7 +4,7 @@
environment:
matrix:
- nodejs_version: "6"
- nodejs_version: "7"
# - nodejs_version: "7"
# Install scripts. (runs after repo cloning)
install:
......
machine:
node:
version: 6
version: 7
dependencies:
pre:
......
......@@ -14,12 +14,10 @@ import test from 'ava'
import StateMonitor from './state-monitor'
test('StateMonitor smoking test', t => {
test('StateMonitor target/current & stable', t => {
const CLIENT_NAME = 'StateMonitorTest'
const sm = new StateMonitor<'A', 'B'>(CLIENT_NAME, 'A')
t.is(sm.client(), CLIENT_NAME, 'should get the same client name as init')
t.is(sm.current(), 'A', 'current should be A')
t.is(sm.target(), 'A', 'target should be A')
t.true(sm.stable(), 'should be stable')
......@@ -47,8 +45,11 @@ test('StateMonitor smoking test', t => {
t.false(sm.stable(), 'should not be stable')
})
test('StateMonitor stable', t => {
const sm = new StateMonitor<'A', 'B'>('StateMonitorTest', 'A')
test('StateMonitor client & stable/inprocess', t => {
const CLIENT_NAME = 'StateMonitorTest'
const sm = new StateMonitor<'A', 'B'>(CLIENT_NAME, 'A')
t.is(sm.client(), CLIENT_NAME, 'should get the same client name as init')
sm.current('B')
t.true(sm.stable(), 'should be stable')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册