chore(v2): fix windows Jest tests (#3959)

* test(v2): Fix docusaurus-utils tests for windows

* test(v2): Fix plugin-client-redirects test

- add the posixPath in writeRedirectsFiles.ts

* test(v2): Fix plugin-content-pages test

add posixPath in test and index

* test(v2): add window test configuration

 - add the window test configuration in nodejs-windows.yml

* test(v2): revert plugin-content-pages test fix

* test(v2): Fix mdx-loader/transformImage test

* test(v2): add cleanPath in transformImage test

* fix version path tests for windows

* make versionMetadata test work on Windows

* try to fix posix/win32 path issues

* attempt to fix windows test

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* try to make source alias less win32 sensitive

* specific jest config for windows

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* attempt to fix windows testing issue

* remove bad cleanPath fn

* try to fix windows tests

* try to fix windows tests

* blog: try to fix windows tests by using same logic as on docs plugin

* try to fix windows tests

* try to fix windows tests

* try to fix windows tests

* try to fix windows tests

* improve the Github CI setup for windows: make jobs run in parallel

* revert GH action change

Co-authored-by: Sachin Kumar Rajput <skr571999@gmail.com>
This commit is contained in:
Sébastien Lorber 2020-12-28 19:50:12 +01:00 committed by GitHub
parent 863a4d85d3
commit 141d062c3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 189 additions and 131 deletions

View file

@ -65,7 +65,7 @@ describe('loadBlog', () => {
'https://github.com/facebook/docusaurus/edit/master/website-1x/blog/date-matter.md',
permalink: '/blog/date-matter',
readingTime: 0.02,
source: path.join('@site', pluginPath, 'date-matter.md'),
source: path.posix.join('@site', pluginPath, 'date-matter.md'),
title: 'date-matter',
description: `date inside front matter`,
date: new Date('2019-01-01'),
@ -87,10 +87,10 @@ describe('loadBlog', () => {
'https://github.com/facebook/docusaurus/edit/master/website-1x/i18n/en/docusaurus-plugin-content-blog/2018-12-14-Happy-First-Birthday-Slash.md',
permalink: '/blog/2018/12/14/Happy-First-Birthday-Slash',
readingTime: 0.015,
source: path.join(
source: path.posix.join(
'@site',
// pluginPath,
path.join('i18n', 'en', 'docusaurus-plugin-content-blog'),
path.posix.join('i18n', 'en', 'docusaurus-plugin-content-blog'),
'2018-12-14-Happy-First-Birthday-Slash.md',
),
title: 'Happy 1st Birthday Slash! (translated)',
@ -112,7 +112,7 @@ describe('loadBlog', () => {
'https://github.com/facebook/docusaurus/edit/master/website-1x/blog/complex-slug.md',
permalink: '/blog/hey/my super path/héllô',
readingTime: 0.015,
source: path.join('@site', pluginPath, 'complex-slug.md'),
source: path.posix.join('@site', pluginPath, 'complex-slug.md'),
title: 'Complex Slug',
description: `complex url slug`,
prevItem: undefined,
@ -133,7 +133,7 @@ describe('loadBlog', () => {
'https://github.com/facebook/docusaurus/edit/master/website-1x/blog/simple-slug.md',
permalink: '/blog/simple/slug',
readingTime: 0.015,
source: path.join('@site', pluginPath, 'simple-slug.md'),
source: path.posix.join('@site', pluginPath, 'simple-slug.md'),
title: 'Simple Slug',
description: `simple url slug`,
prevItem: undefined,
@ -162,7 +162,7 @@ describe('loadBlog', () => {
'website-blog-without-date',
);
const blogPosts = await getBlogPosts(siteDir);
const noDateSource = path.join('@site', pluginPath, 'no date.md');
const noDateSource = path.posix.join('@site', pluginPath, 'no date.md');
const noDateSourceBirthTime = (
await fs.stat(noDateSource.replace('@site', siteDir))
).birthtime;