-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhelpers.spec.js
49 lines (45 loc) · 1.41 KB
/
helpers.spec.js
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const helpers = require("./helpers");
describe("extract urls from url", function () {
it("should be defined", function () {
expect(helpers.extractUrls).toBeDefined();
});
it("test output to be defined", function () {
expect(helpers.extractUrls("/about\n/test\n/google")).toBeInstanceOf(Array);
});
it("should be a function", function () {
expect(helpers.extractUrls).toBeInstanceOf(Function);
});
});
describe("read python file", () => {
it("should be defined", () => {
expect(helpers.extractFile).toBeDefined();
});
it("should be defined", () => {
expect(helpers.extractFile("")).toEqual(undefined);
});
it("should be a function", () => {
expect(helpers.extractFile).toBeInstanceOf(Function);
});
});
describe("generate tasks for locust", () => {
it("should be defined", () => {
expect(helpers.generateTasks).toBeDefined();
});
it("should be empty with empty array", () => {
expect(helpers.generateTasks([])).toEqual("");
});
it("should be a function", () => {
expect(helpers.generateTasks).toBeInstanceOf(Function);
});
});
describe("generate locust file", () => {
it("should be defined", () => {
expect(helpers.generateFile).toBeDefined();
});
it("should be empty ", () => {
expect(helpers.generateFile("")).toContain("import random");
});
it("should be a function", () => {
expect(helpers.generateFile).toBeInstanceOf(Function);
});
});