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.

💡 - Optional sorted / sequential test files

See original GitHub issue

Description

Some test files need other test files to be run first, so making the sort optional would be interesting.

Package version

"devDependencies": {
  "japa": "^3.1.1",
}

Relevant Information

I was thinking about a Pull Request for this feature, adjusting the “configure” function and the “Loader/loadFiles”, so making filesPaths.sort() optional and default true.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
thetutlagecommented, Jan 7, 2022

Not a big fan of this approach. However, I will add an API to apply a custom sort to the files in the next version

1reaction
luizxsotocommented, Sep 8, 2021

Exactly, taking into account that the ordering is by file name, it does not allow different people to order the test files sequence in the way they prefer. Making the ordering optional and setting it to false, will make it follow the order passed in the files array.

Example:

import { configure } from 'japa'

configure({
  sort: false,

  // Expected Behavior
  files: ['file 2 that run first', 'file 1 that run second'],
  
  // Current Behavior
  files: ['file 2 that run second', 'file 1 that run first'],
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Ability to run spec files in a specific order #390
How can I run all tests in a order without rename the files using a number to determine the order to execute?
Read more >
Testing sequential order - HighBond
Testing sequential order (the Examine Sequence option) allows you to verify whether data has already been sorted or indexed, or whether it needs...
Read more >
Sequential File stage: Partitioning tab
The Partitioning tab allows you to specify details about how the incoming data is partitioned or collected before it is written to the...
Read more >
The Python Sort List Array Method – Ascending and ...
How to sort a list in ascending and descending order. ... To customize how the sort() method works, you can pass two optional...
Read more >
DBMS - Sorted Files - YouTube
DBMS - Sorted FilesWatch more Videos at https://www.tutorialspoint.com/videotutorials/index.htmLecture By: Mr. Arnab Chakraborty, ...
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