Skip to content

Commit a2b11e8

Browse files
committed
Format k6/**
1 parent 58ff659 commit a2b11e8

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

k6/root.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { check } from 'k6';
2-
import http from 'k6/http';
3-
import { defaultOptions, url } from './lib/util.js';
4-
5-
export const options = defaultOptions();
6-
7-
export default () => {
8-
const rootUrl = url('');
9-
check(http.get(rootUrl), {
10-
'status was 200': (res) => res.status === 200,
11-
'includes expected text': (res) => res.body?.toString()?.includes('Hello WORLD!'),
12-
});
13-
};
1+
import { check } from 'k6';
2+
import http from 'k6/http';
3+
import { defaultOptions, url } from './lib/util.js';
4+
5+
export const options = defaultOptions();
6+
7+
export default () => {
8+
const rootUrl = url('');
9+
check(http.get(rootUrl), {
10+
'status was 200': (res) => res.status === 200,
11+
'includes expected text': (res) => res.body?.toString()?.includes('Hello WORLD!'),
12+
});
13+
};

k6/streaming.js

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { check } from 'k6';
2-
import http from 'k6/http';
3-
import { defaultOptions, url } from './lib/util.js';
4-
5-
export const options = defaultOptions();
6-
7-
export default () => {
8-
const streamingUrl = url('stream_async_components?delay=5');
9-
check(http.get(streamingUrl), {
10-
'status was 200': (res) => res.status === 200,
11-
'has all comments': (res) => {
12-
const body = res.html().text();
13-
const commentIds = [1, 2, 3, 4];
14-
const hasAllComments = commentIds.every((commentId) => body.includes(`Comment ${commentId}`));
15-
const hasFailedRequests = !!body.match(/Request to .+ failed/i);
16-
return hasAllComments && !hasFailedRequests;
17-
},
18-
});
19-
};
1+
import { check } from 'k6';
2+
import http from 'k6/http';
3+
import { defaultOptions, url } from './lib/util.js';
4+
5+
export const options = defaultOptions();
6+
7+
export default () => {
8+
const streamingUrl = url('stream_async_components?delay=5');
9+
check(http.get(streamingUrl), {
10+
'status was 200': (res) => res.status === 200,
11+
'has all comments': (res) => {
12+
const body = res.html().text();
13+
const commentIds = [1, 2, 3, 4];
14+
const hasAllComments = commentIds.every((commentId) => body.includes(`Comment ${commentId}`));
15+
const hasFailedRequests = !!body.match(/Request to .+ failed/i);
16+
return hasAllComments && !hasFailedRequests;
17+
},
18+
});
19+
};

0 commit comments

Comments
 (0)