You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,14 @@ Be sure to check out the resource you create in each test and remember to delete
31
31
When running a test, you might need information such as ID that you cannot know in advance (such as ID of resources).
32
32
The `core.Test` uses different helpers to pass useful information around.
33
33
34
-
One of them is the [`core.testMetadata`](https://github.com/scaleway/scaleway-cli/blob/v2/internal/core/testing.go#L80).
34
+
One of them is the [`core.testMetadata`](https://github.com/scaleway/scaleway-cli/blob/master/internal/core/testing.go#L80).
35
35
It is designed to store information such as ID or object describing a resource during a test.
36
36
This metadata can use the `render` method to provide helpful golang templating features to have commands arguments computed dynamically.
37
37
38
38
#### BeforeFunc and AfterFunc
39
39
40
40
Usually, you might need to set up and teardown resources when you are running a test for testing a specific command.
41
-
For that you can use [`BeforeFunc`](https://github.com/scaleway/scaleway-cli/blob/v2/internal/core/testing.go#L84) and [`AfterFunc`](https://github.com/scaleway/scaleway-cli/blob/v2/internal/core/testing.go#L86).
41
+
For that you can use [`BeforeFunc`](https://github.com/scaleway/scaleway-cli/blob/master/internal/core/testing.go#L100) and [`AfterFunc`](https://github.com/scaleway/scaleway-cli/blob/master/internal/core/testing.go#L102).
42
42
Those types allow you to execute code before (`BeforeFunc`) or after (`AfterFunc`) the main command you want to test.
43
43
Those functions can access the metadata to change dynamically their behavior.
44
44
@@ -75,4 +75,4 @@ If you want to contribute new tests you should have the following:
75
75
- Install go for your platform
76
76
- Install your credentials, preferably in a configuration file (run `scw init`)
77
77
- Keep in mind that if you record interaction, the resource you will instantiate will be delivered and billed.
78
-
- Clean up the resource you don't use once the recording is over.
78
+
- Clean up the resource you don't use once the recording is over.
0 commit comments