basic tests for alpine go and yarn

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-02-24 19:18:24 -08:00
parent 256f373a52
commit 81cdccf541
7 changed files with 145 additions and 1 deletions

11
tests/stdlib/yarn/testdata/package.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"name": "test",
"main": "index.js",
"license": {
"type": "Apache-2.0",
"url": "https://opensource.org/licenses/apache2.0.php"
},
"scripts": {
"build": "mkdir -p ./build && echo output > ./build/test && touch .env && cp .env ./build/"
}
}

View File

@@ -0,0 +1,35 @@
package yarn
import (
"dagger.io/dagger"
"dagger.io/yarn"
"dagger.io/alpine"
)
TestData: dagger.#Dir
TestYarn: {
run: yarn.#Script & {
source: TestData
}
test: #dagger: compute: [
dagger.#Load & {from: alpine.#Image & {
package: bash: "=5.1.0-r0"
}},
dagger.#Exec & {
mount: "/build": from: run
args: [
"/bin/bash",
"--noprofile",
"--norc",
"-eo",
"pipefail",
"-c",
"""
test "$(cat /build/test)" = "output"
""",
]
},
]
}