Skip to content

Commit

Permalink
feat(core): error when unknown engine is used in before/after
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed Jan 4, 2024
1 parent 653daab commit 4baa50b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/core/lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,12 @@ function handleScriptHook(hook, script, hookEvents, contextVars = {}) {

const name = script[hook].engine || 'http';
const engine = engines.find((e) => e.__name === name);

if (typeof engine === 'undefined') {
throw new Error(
`Failed to run ${hook} hook: unknown engine "${name}". Did you forget to include it in "config.engines.${name}"?`
);
}
const hookScenario = engine.createScenario(script[hook], ee);
const hookContext = createContext(script, contextVars, {
scenario: script[hook]
Expand Down

0 comments on commit 4baa50b

Please sign in to comment.