From d62aff4483031b16c47719656bd31bda4ba11c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Sun, 23 May 2021 14:05:30 +0200 Subject: [PATCH] Add failing test for `request for ... is not yet fulfilled` --- e2e/native-esm/__tests__/native-esm.test.js | 4 ++++ e2e/native-esm/file1.js | 1 + e2e/native-esm/file2.js | 1 + e2e/native-esm/sharedImport.js | 1 + e2e/native-esm/sharedImportDep.js | 1 + 5 files changed, 8 insertions(+) create mode 100644 e2e/native-esm/file1.js create mode 100644 e2e/native-esm/file2.js create mode 100644 e2e/native-esm/sharedImport.js create mode 100644 e2e/native-esm/sharedImportDep.js diff --git a/e2e/native-esm/__tests__/native-esm.test.js b/e2e/native-esm/__tests__/native-esm.test.js index 0b2a0a009d6b..3ecfcf827a01 100644 --- a/e2e/native-esm/__tests__/native-esm.test.js +++ b/e2e/native-esm/__tests__/native-esm.test.js @@ -171,6 +171,10 @@ test('handle dynamic imports of the same module in parallel', async () => { expect(first(2)).toBe(4); }); +test('import same file with child imports in parallel indirectly', async () => { + await Promise.all([import('../file1.js'), import('../file2.js')]); +}); + test('varies module cache by query', () => { expect(staticImportedStatefulWithQuery).not.toBe( staticImportedStatefulWithAnotherQuery, diff --git a/e2e/native-esm/file1.js b/e2e/native-esm/file1.js new file mode 100644 index 000000000000..140016b22923 --- /dev/null +++ b/e2e/native-esm/file1.js @@ -0,0 +1 @@ +import './sharedImport.js'; diff --git a/e2e/native-esm/file2.js b/e2e/native-esm/file2.js new file mode 100644 index 000000000000..140016b22923 --- /dev/null +++ b/e2e/native-esm/file2.js @@ -0,0 +1 @@ +import './sharedImport.js'; diff --git a/e2e/native-esm/sharedImport.js b/e2e/native-esm/sharedImport.js new file mode 100644 index 000000000000..38c4e3bb5555 --- /dev/null +++ b/e2e/native-esm/sharedImport.js @@ -0,0 +1 @@ +import './sharedImportDep.js'; diff --git a/e2e/native-esm/sharedImportDep.js b/e2e/native-esm/sharedImportDep.js new file mode 100644 index 000000000000..042278a37b3b --- /dev/null +++ b/e2e/native-esm/sharedImportDep.js @@ -0,0 +1 @@ +import './index.js';