Skip to content

Commit

Permalink
Merge pull request #16 from szkiba/feat/15-add-current-directory-as-s…
Browse files Browse the repository at this point in the history
…ource-root-to-sourcemap

Feat/15 add current directory as source root to sourcemap
  • Loading branch information
szkiba authored Apr 18, 2024
2 parents 9f102d3 + 34e503f commit 782640f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions examples/abort.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import exec from "k6/execution";

export default function () {
exec.test.abort("failed");
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
github.com/sirupsen/logrus v1.9.3
github.com/szkiba/k6pack v0.1.2
github.com/szkiba/k6pack v0.1.3
go.k6.io/k6 v0.50.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/szkiba/k6pack v0.1.2 h1:r4nrAYP4UoC7RSgORGRWvY27Fe1pDCR14vSj3ifKoYw=
github.com/szkiba/k6pack v0.1.2/go.mod h1:2yxZBwXidrURozrVZWwohqqEOjdCVyHCZPSKu77i7Bc=
github.com/szkiba/k6pack v0.1.3 h1:WtHNH2Q37695YA+3uGwPRgsOu/0wqBUcfOA5MBdedSo=
github.com/szkiba/k6pack v0.1.3/go.mod h1:2yxZBwXidrURozrVZWwohqqEOjdCVyHCZPSKu77i7Bc=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.k6.io/k6 v0.50.0 h1:2AMTXJ37QTmfUZ4ykitWNyIzVJTBQ7mBvlTbzHSmYoU=
Expand Down
7 changes: 5 additions & 2 deletions loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ func redirectStdin() {
return
}

cwd, _ := os.Getwd()

opts := &k6pack.Options{
Filename: filename,
SourceMap: os.Getenv("XK6_TS_SOURCEMAP") != "false",
Filename: filename,
SourceMap: os.Getenv("XK6_TS_SOURCEMAP") != "false",
SourceRoot: cwd,
}

source, err := os.ReadFile(filepath.Clean(filename))
Expand Down

0 comments on commit 782640f

Please sign in to comment.