Skip to content

Commit 2fe134f

Browse files
committed
test(*): fix breaking tests
1 parent 722114e commit 2fe134f

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

bin/karma.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { spawn } = require('child_process')
22
const chalk = require('chalk')
33
const ws = require('./server')
44

5-
ws.start(8080)
5+
ws.start(null, 8080)
66
console.log(chalk`{green > started websocket server on port 8080}`)
77

88
const test = spawn('npm', ['run', 'test:karma:local'])

bin/qunit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,5 +186,5 @@ async function start () {
186186
}
187187

188188
start()
189-
.then(console.log)
190-
.catch(console.log)
189+
.then(console.log)
190+
.catch(console.log)

bin/saucelabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ sauceLabs.createTestsJob = function (browsers, url) {
7979
url: url,
8080
framework: 'qunit'
8181
})
82-
.then((body) => body['js tests'])
82+
.then((body) => body['js tests'])
8383
}
8484

8585
/**

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"karma-sourcemap-loader": "^0.3.7",
4444
"ngrok": "^3.0.0",
4545
"opn": "^5.3.0",
46+
"pify": "^3.0.0",
4647
"puppeteer": "^1.2.0",
4748
"rollup": "^0.57.0",
4849
"rollup-plugin-babel": "^3.0.3",

test/unit/json-encoder.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
*/
1111

1212
import JsonEncoder from '../../src/JsonEncoder/index.js'
13-
import util from 'util'
13+
import promisify from 'pify'
1414

1515
group('JsonEncoder', (group) => {
1616
test('encode value', async (assert) => {
17-
const payload = await util.promisify(JsonEncoder.encode)({ name: 'virk' })
17+
const payload = await promisify(JsonEncoder.encode)({ name: 'virk' })
1818
assert.equal(payload, JSON.stringify({ name: 'virk' }))
1919
})
2020

@@ -30,14 +30,14 @@ group('JsonEncoder', (group) => {
3030
})
3131

3232
try {
33-
await util.promisify(JsonEncoder.encode)(obj)
33+
await promisify(JsonEncoder.encode)(obj)
3434
} catch ({ message }) {
3535
assert.equal(message, 'bad')
3636
}
3737
})
3838

3939
test('decode json string', async (assert) => {
40-
const payload = await util.promisify(JsonEncoder.decode)(JSON.stringify({ name: 'virk' }))
40+
const payload = await promisify(JsonEncoder.decode)(JSON.stringify({ name: 'virk' }))
4141
assert.deepEqual(payload, { name: 'virk' })
4242
})
4343
})

0 commit comments

Comments
 (0)