-
Notifications
You must be signed in to change notification settings - Fork 4
/
detect_test.go
42 lines (35 loc) · 922 Bytes
/
detect_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package ubinodejsextension_test
import (
"testing"
ubinodejsextension "github.com/paketo-community/ubi-nodejs-extension"
. "github.com/onsi/gomega"
"github.com/paketo-buildpacks/packit/v2"
"github.com/sclevine/spec"
)
var expectedDetectBuildPlan packit.BuildPlan = packit.BuildPlan{
Provides: []packit.BuildPlanProvision{
{Name: "node"},
},
Or: []packit.BuildPlan{
{
Provides: []packit.BuildPlanProvision{
{Name: "node"},
{Name: "npm"},
},
},
},
}
func testDetect(t *testing.T, context spec.G, it spec.S) {
var (
Expect = NewWithT(t).Expect
err error
detectResult packit.DetectResult
)
it("it returns a plan that provides node and/or npm", func() {
detectResult, err = ubinodejsextension.Detect()(packit.DetectContext{
WorkingDir: "/working-dir",
})
Expect(err).NotTo(HaveOccurred())
Expect(detectResult.Plan).To(Equal(expectedDetectBuildPlan))
})
}