feature-starter icon indicating copy to clipboard operation
feature-starter copied to clipboard

How can I source dev-container-features-test-lib in my devcontainer or wsl?

Open AceHack opened this issue 2 years ago • 2 comments

Whenever I try to run the test command in my devcontainer it fails and says dev-container-features-test-lib can't be found. How do I include that?

AceHack avatar May 17 '23 02:05 AceHack

Those functions are only available when running a test with the devcontainer features test ... command. You can include those functions by adding source dev-container-features-test-lib to the top of your bash script (make sure to add #!/bin/bash to the top of the script).

An example can be seen here: https://github.com/devcontainers/feature-starter/blob/main/test/color/test.sh#L38

More info/documentation can be found here: https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib

joshspicer avatar May 17 '23 14:05 joshspicer