Skip to content

Commit 7a76440

Browse files
committed
random-string-test
1 parent 090a43b commit 7a76440

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/createRandomString.test.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
import { generateRandomString } from "../src";
3+
4+
5+
6+
7+
describe("Communications between a Mobile App and a Device App", () => {
8+
9+
test('tests for messages sent between a mobile app and a device app', () => {
10+
const stringLength = 20;
11+
const generatedStrings = [];
12+
for (let i = 0; i < 1000; i++) {
13+
const randomString1 = generateRandomString(stringLength);
14+
console.log(randomString1);
15+
expect(randomString1.length).toBe(stringLength);
16+
const duplicates = generatedStrings.filter(f => f === randomString1);
17+
//expect(duplicates.length).toBe(0);
18+
generatedStrings.push(randomString1);
19+
}
20+
21+
22+
});
23+
24+
25+
});

0 commit comments

Comments
 (0)