question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow reading tests from files

See original GitHub issue

It’s possible to read prerequest scripts from a file by prefixing it with file:. It would be great if that were possible for tests, too.

This configuration

  "tests": {
    "extendTests": [
      {
        "openApiOperation": "*::/*",
        "tests": [
          "file:portman/tests.js"
        ]
      }
    ]
  },

sets all tests to the literal value file:portman/tests.js.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
thim81commented, Apr 1, 2022

@wedi @jopucpla A PR has been provided, so support for using file: for extendTest will land in the next release of Portman.

0reactions
jopucplacommented, Apr 4, 2022

Thank you ! 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reading files - Learn Go with tests - GitBook
If we prove that we can read all the files in a directory, that will be a good start. This will give us...
Read more >
Reading a file before testing a method - it is an integration test ...
I think that it is a unit test because still I test only my parser, not reading data from file. But I cannot...
Read more >
Is file access in unit tests bad? - Stack Overflow
Strictly speaking, unit tests should not use the file system because it is slow. However, readability is more important. XML in a file...
Read more >
Reading / Writing on Files | python-testing-by-examples
Reading Files ; Writing on Files. Reading Files. Let's say I have a method that returns the number of lines from a file....
Read more >
Using files in unit tests - DataMiner Dojo
Sometimes, you need to create tests that use one or more files as test data. ... Let's have a look at an example...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found