From deb0daa7f3ba23a092b20d3ac0b1728e18078bfc Mon Sep 17 00:00:00 2001 From: Anton Nikolaev Date: Tue, 28 Apr 2020 04:56:12 -0700 Subject: [PATCH] Fix tests on Windows (#1072) Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/1072 Once again fixed GH windows jobs which are currently failing Reviewed By: mweststrate Differential Revision: D21277273 fbshipit-source-id: 0df6ee7eb00b8f72bd6952747fa0e25e787ca335 --- desktop/pkg/src/__tests__/runLint.node.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop/pkg/src/__tests__/runLint.node.ts b/desktop/pkg/src/__tests__/runLint.node.ts index c4e2efe04..e12d5715c 100644 --- a/desktop/pkg/src/__tests__/runLint.node.ts +++ b/desktop/pkg/src/__tests__/runLint.node.ts @@ -9,6 +9,7 @@ import runLint from '../utils/runLint'; import fs from 'fs-extra'; +import path from 'path'; const validPackageJson = { $schema: 'https://fbflipper.com/schemas/plugin-package/v2.json', @@ -124,7 +125,9 @@ test('flippeBundlerEntry must point to an existing file', async () => { testPackageJson.flipperBundlerEntry = 'unexisting/file'; fs.pathExistsSync = jest .fn() - .mockImplementation((path) => !path.includes('unexisting/file')); + .mockImplementation( + (filePath) => !filePath.includes(path.join('unexisting', 'file')), + ); const json = JSON.stringify(testPackageJson); fs.readFile = jest.fn().mockResolvedValue(new Buffer(json)); const result = await runLint('dir');