Replies: 2 comments
-
|
hi @osukaa 👋 There's not much that can be done statically. One option would be to convert it to TypeScript and add some typings. We're working on providing more types from Artillery but it's a work-in-progress. Another option would be to add some tests - unit-style tests to individual functions exported from that file, or a simple end-to-end to test that runs a smoke test with Artillery that uses those functions. If you have any thoughts would appreciate that as well. It's an area we want to improve |
Beta Was this translation helpful? Give feedback.
-
|
I don't know the internals of the library, but if I want to mock the http calls for the purpose of sanity checking, I would like the ability to require e.g., // using AVA
const artillery = require('artillery'); // or require('artillery/test');
test('sanity check serviceA/scenarioX', (t) => {
t.notThrows(() => artillery.load(`my/script/path/${serviceA}/${scenarioX}.yaml`));
// and/or
nock('http://www.serviceA.com')
.get('/resourceX')
.reply(200, 'domain matched');
t.notThrowsAsync(() => artillery.run(`my/script/path/${serviceA}/${scenarioX}.yaml`, { overrides: { phases : [{ duration: 1 }] }}));
}) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In our current artillery setup, we use a repository to hold the YAML and JS files for the tests, but I wanted to add a step in the build that at least validates the js file would work correctly with artillery.
Is there a recommend way to do this?
Beta Was this translation helpful? Give feedback.
All reactions