Code Monkey home page Code Monkey logo

Comments (5)

simbadltd avatar simbadltd commented on August 23, 2024

Hello. Please share the following:

  1. k6 version
  2. Full source code or reproduction steps

from k6-junit.

poponuts avatar poponuts commented on August 23, 2024

k6 version 0.39.0

https://github.com/poponuts/k6-junit-boilerplate
run as per README: k6 run -e ENVIRONMENT=test -e test/booking.api.ts

from k6-junit.

simbadltd avatar simbadltd commented on August 23, 2024

@poponuts Thanks for the additional info. So, the root cause is that you're running k6 against TypeScript test. To make it work you need:

  1. Run webpack to build plain js test files (like this: webpack --stats-error-details)
  2. Run k6 against js test files (like this: k6 run test.js)

If u want I can publish an example.

from k6-junit.

poponuts avatar poponuts commented on August 23, 2024

Sorry, if I understand you correctly, does this mean that your package can only work on js files and not ts files?
I tried to use this official k6 repo as a reference for typescript tests: https://github.com/grafana/k6-template-typescript and they work fine without the k6-junit package.

from k6-junit.

simbadltd avatar simbadltd commented on August 23, 2024

@poponuts It can work both ways, but it would be more correctly to transpile with webpack (see also this). If it is mandatory to keep using ts without transpiling then u need to update ur exports:

From:

import {jUnit} from "k6-junit";

To:

import {jUnit} from "./node_modules/k6-junit/index.js";

from k6-junit.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.