summaryrefslogtreecommitdiff
path: root/src/node_modules/chance/test/test.mobile.js
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2021-12-21 16:52:28 +0100
committerMinteck <contact@minteck.org>2021-12-21 16:52:28 +0100
commit46e43f4bde4a35785b4997b81e86cd19f046b69b (patch)
treec53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/chance/test/test.mobile.js
downloadlangdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz
langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2
langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip
Commit
Diffstat (limited to 'src/node_modules/chance/test/test.mobile.js')
-rw-r--r--src/node_modules/chance/test/test.mobile.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/node_modules/chance/test/test.mobile.js b/src/node_modules/chance/test/test.mobile.js
new file mode 100644
index 0000000..5361d80
--- /dev/null
+++ b/src/node_modules/chance/test/test.mobile.js
@@ -0,0 +1,29 @@
+import test from 'ava'
+import Chance from '../chance.js'
+import _ from 'lodash'
+
+const chance = new Chance()
+
+// chance.android_id()
+test('android_id() returns a proper android id', t => {
+ _.times(1000, () => t.true(/APA91([0-9a-zA-Z-_]){178}/.test(chance.android_id())))
+})
+
+// chance.apple_token()
+test('apple_token() returns a proper apple push token', t => {
+ _.times(1000, () => t.true(/([0-9a-fA-F]){64}/.test(chance.apple_token())))
+})
+
+// chance.wp8_anid2()
+test('wp8_anid2() returns a proper windows phone 8 anid2', t => {
+ _.times(1000, () => t.true(/^([0-9a-zA-Z]){43}=$/.test(chance.wp8_anid2())))
+})
+
+// chance.wp7_anid()
+test('wp7_anid() returns a proper windows phone 7 anid', t => {
+ _.times(1000, () => t.true(/^A=[0-9A-F]{32}&E=[0-9a-f]{3}&W=\d$/.test(chance.wp7_anid())))
+})
+
+test('bb_pin() returns a proper blackberry pin', t => {
+ _.times(1000, () => t.true(/([0-9a-f]){8}/.test(chance.bb_pin())))
+})