Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support initialization of test context #23

Closed
jstokes opened this issue Aug 16, 2018 · 1 comment
Closed

Support initialization of test context #23

jstokes opened this issue Aug 16, 2018 · 1 comment

Comments

@jstokes
Copy link
Member

jstokes commented Aug 16, 2018

Tests always start with an empty context, occasionally you want some information available in the context from the start of a test. It's possible to create a dummy step to fill in these context values as:

#::step{:name 'filling-context
        :title "Filling context values"
        :inputs {}
        :test (constantly "my-output-value")
        :output :foo/bar}

Which creates a context of {:foo/bar "my-output-value"} available to all subsequent steps.

@jstokes
Copy link
Member Author

jstokes commented Oct 14, 2018

(deftest with-initial-context
  {::test/description "Test with initial context"
   ::test/context {:a 42}})

@jstokes jstokes closed this as completed Oct 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant