File: test.mobile.js

package info (click to toggle)
node-chance 2.2.6%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,612 kB
  • sloc: javascript: 16,572; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 985 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const Chance = require('../chance.js')
const _ = require('lodash')

const chance = new Chance()

// chance.android_id()
test('android_id() returns a proper android id', () => {
    _.times(1000, () => expect(/APA91([0-9a-zA-Z-_]){178}/.test(chance.android_id())).toBe(true))
})

// chance.apple_token()
test('apple_token() returns a proper apple push token', () => {
    _.times(1000, () => expect(/([0-9a-fA-F]){64}/.test(chance.apple_token())).toBe(true))
})

// chance.wp8_anid2()
test('wp8_anid2() returns a proper windows phone 8 anid2', () => {
    _.times(1000, () => expect(/^([0-9a-zA-Z]){43}=$/.test(chance.wp8_anid2())).toBe(true))
})

// chance.wp7_anid()
test('wp7_anid() returns a proper windows phone 7 anid', () => {
    _.times(1000, () => expect(/^A=[0-9A-F]{32}&E=[0-9a-f]{3}&W=\d$/.test(chance.wp7_anid())).toBe(true))
})

test('bb_pin() returns a proper blackberry pin', () => {
    _.times(1000, () => expect(/([0-9a-f]){8}/.test(chance.bb_pin())).toBe(true))
})