mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
move the remaining RippleAPI tests to the new test runner
This commit is contained in:
29
test/api/constructor/index.ts
Normal file
29
test/api/constructor/index.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import assert from 'assert-diff'
|
||||
import { TestSuite } from '../../utils'
|
||||
import { RippleAPI } from 'ripple-api'
|
||||
|
||||
/**
|
||||
* Every test suite exports their tests in the default object.
|
||||
* - Check out the "TestSuite" type for documentation on the interface.
|
||||
* - Check out "test/api/index.ts" for more information about the test runner.
|
||||
*/
|
||||
export default <TestSuite>{
|
||||
'RippleAPI - implicit server port': () => {
|
||||
new RippleAPI({ server: 'wss://s1.ripple.com' })
|
||||
},
|
||||
|
||||
'RippleAPI invalid options': () => {
|
||||
// @ts-ignore - This is intentionally invalid
|
||||
assert.throws(() => new RippleAPI({ invalid: true }))
|
||||
},
|
||||
|
||||
'RippleAPI valid options': () => {
|
||||
const api = new RippleAPI({ server: 'wss://s:1' })
|
||||
const privateConnectionUrl = (api.connection as any)._url
|
||||
assert.deepEqual(privateConnectionUrl, 'wss://s:1')
|
||||
},
|
||||
|
||||
'RippleAPI invalid server uri': () => {
|
||||
assert.throws(() => new RippleAPI({ server: 'wss//s:1' }))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user