Skip to content

Accessing a fileset's resource files from tests #55

@kommen

Description

@kommen

I'm trying to set up a test system where a test case is automatically generated based on test data present in the file system including the expected output. However, I can't figure out how to access those files from within the test runner.

A simplified example:

(deftask backend-test []
  (merge-env! :source-paths ["clj/backend/src" "clj/backend/test"]
              :resource-paths ["clj/backend/fixtures"])
  (test-cljs :js-env :node :exit? true))

Directory structure of clj/backend:

|- src
|- test
|- fixtures
  |- test-data
      |- sample-input-1.edn
      |- expected-output-1.html
      |- sample-input-2.edn
      |- expected-output-2.html

Is it possible to somehow make the contents of clj/backend/fixtures accessible from the test runner so I can generate test cases based on the contents of test-data?

I saw that e.g node_modules is manually moved into the tmp dir: https://github.com/crisptrutski/boot-cljs-test/blob/master/src/crisptrutski/boot_cljs_test.clj#L136

So I guess I would somehow have to do that with the files I want to use as well?

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions