A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/grafana/k6-template-es6 below:

grafana/k6-template-es6: Template using Webpack and Babel to enable ES6 features in k6 tests

Warning

This template is deprecated due to native ES6+TypeScript support released in k6 v0.52.0. Set the --compatibility-mode=experimental_enhanced option to use it. Check the documentation for the details.

This is a template repository showing how to use Babel and Webpack to bundle the different files into CommonJS modules, using its webpack.config.js configuration.

In this project, you can write k6 tests using:

  1. node module resolution.
  2. external node modules and getting them automatically bundled.
  3. unsupported ES+ features like the optional chaining ( ?. ) operator.

Click Use this template to create a repository from this template.

Clone the generated repository on your local machine, move to the project root folder and install the dependencies defined in package.json

Attempting to run the tests in src will fail because:

To address this, we'll use Webpack to bundle the dependencies and polyfill ES+ features.

This command creates the final test files to the ./dist folder.

Once that is done, we can run our script the same way we usually do, for instance:

k6 run dist/optional-chaining-test.js
# or 
k6 run dist/faker-test.js

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4