Skip to content

Commit 42393f8

Browse files
committed
add k6 new command
1 parent a964997 commit 42393f8

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Modules/II-k6-Foundations/01-Getting-started-with-k6-OSS.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ Time to write the script!
1919

2020
k6 supports multiple protocols, but for now, let's stick to HTTP. Your first script will do a basic HTTP POST request against a test API that will echo back whatever you send to it.
2121

22-
Create a new file named `test.js`, and open it in your favorite IDE. This file is our test script. k6 scripts are always written in JavaScript, even though k6 itself is written in Go. We're going to create the script together, step by step. Copy and paste the code snippets as necessary, so that your script looks like the one here.
22+
The fastest way to create a k6 test is to use the `k6 new [filename]` command introduced in k6 version 0.48.0. This will automatically create a file with the basic boilerplate you need to get you up and running quickly.
23+
24+
But, as part of your k6 learning, we will also teach you how to create a test manually.
25+
26+
Create a new file named `test.js`, and open it in your favorite IDE. This file is our test script. k6 scripts are always written in JavaScript, even though k6 itself is written in Go. We're going to create the script together, step by step. Copy and paste the code snippets as necessary, so that your script looks like the one here.
2327

2428
Import the HTTP Client from the built-in module `k6/http`:
2529

slides/04-getting-started-with-k6-oss/slides.md

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ export default function() {
4545

4646
---
4747

48+
## Writing your first k6 script
49+
50+
Alternatively, you can also run `k6 new [filename]` to automatically create a file with the basic boilerplate to get you up and running quickly. 😉
51+
52+
---
53+
4854
## Hello World: running your k6 script
4955

5056
Run the command below on a terminal:

0 commit comments

Comments
 (0)