test(docs-infra): fix preview server unit tests on Windows (#25671)
Some tests where comparing actual with expected paths, without taking into account that paths will be different on Windows. This commit uses `path.resolve()` to convert expected paths to their OS-specific form. PR Close #25671
This commit is contained in:

committed by
Kara Erickson

parent
35d70ff265
commit
897261efdc
@ -1,4 +1,5 @@
|
||||
// Imports
|
||||
import {resolve as resolvePath} from 'path';
|
||||
import {
|
||||
assert,
|
||||
assertNotMissingOrEmpty,
|
||||
@ -39,7 +40,7 @@ describe('utils', () => {
|
||||
const sha = 'ABCDEF1234567';
|
||||
const artifactPath = 'a/path/to/file.zip';
|
||||
const path = computeArtifactDownloadPath(downloadDir, pr, sha, artifactPath);
|
||||
expect(path).toEqual('/a/b/c/123-ABCDEF1-file.zip');
|
||||
expect(path).toBe(resolvePath('/a/b/c/123-ABCDEF1-file.zip'));
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user