Docusaurus: Make Jest tests cross-platform (fix Jest tests on Windows)

Created on 24 Sep 2020  路  9Comments  路  Source: facebook/docusaurus

馃挜 Proposal

Make Jest tests cross-platform (fix Jest tests on Windows). The tests are failing mostly because of various paths related issues. I was trying to fix some of them but without a success (using slash and path.normalize).

  • #3481 - this PR adds the test step to the Windows CI

Have you read the [Contributing Guidelines on issues]

Yes

good first issue hacktoberfest help wanted proposal

All 9 comments

Hey @slorber

Can I work on the Issue ?

Hi @skr571999 , if you have Windows and can make the tests pass without breaking anything, this is welcome ;)

@slorber ,Thanks

I have Window 10, I am new to testing but will try my best to pass them. 馃殌

Hey @slorber ,

As u mention, in PR #3481 about the posixPath() , while I was debugging, I found that some of the Test Cases are failing because of not using this function while comparing the paths. So i tried by using it, then they are working fine.

Question 馃

1- Should I send the PR after passing all the test cases or will it be fine to send the PR after passing the Test Case for Every Package differently ?

Hi @skr571999

Honestly I don't know exactly how this problem should be solved and if posixPath is the solution.

You can make a draft PR with some fixed tests but I guess the idea is that the PR tests should pass otherwise we can't merge it.

If you find a way to enable windows jest tests package by package we could merge it even if all windows test are not fixed, but having. all tests running on Windows at once would be a better option.

ok

I will look .

Hi @slorber

I Worked over the Tescases and now Status is

image

But there is one Problem that due to some changes the Build is not Successfully running. Because to pass some test case I have made some changes in utils files which are breaking the Build.

Due to this Problem I am thinking that it can be better if we Merge the (PRs) with window fixes Package by package because due to fixes that may break other things.

I noticed the Current testing happening on GitHub is not running the Test Cases for Windows until we merge this Draft PR (#3481)

so what I think we can do

  • I will pass the Test Case and also check for Build for a Package (Like. docusaurus-utils ) on Windows (on my local system)
  • then, i will send the PR for that so it will run all (Test, Builds) on Github for Linux as it running currently
  • if that passes then we can merge that

After all the Tescase Passes on window(Locally) and on Linux on GitHub

  • Then, we can merge this Draft PR (#3481)
  • After Merging this It will check it the Test Cases are running on Both of the Machine On GitHub.

馃 What you think about this way of doing or is there anything else we can do ?

Hi,

The PR we merge shouldn't break existing tests on Linux.

However if you feel it's simpler to enable Windows tests package by package, I think it's better to have half the tests working on windows than all windows tests disabled. We can improve incrementally as long as the Linux behavior is not changed.

Temporarily we can enable windows tests to a subset of all packages, instead of all like in the draft PR:

image

ok, Thanks @slorber

I will send the PR after some Test Cases Fix completely.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

awibox picture awibox  路  3Comments

cheercroaker picture cheercroaker  路  3Comments

lex111 picture lex111  路  3Comments

endiliey picture endiliey  路  3Comments

azu picture azu  路  3Comments