Ghost/ghost/core/test
Daniel Lockyer 044b342de3
Fixed random test failure due to asynchronous directory creation
- we keep seeing random failures that complain about a directory already
  existing when trying to create it
- the error arises from the `fs.copySync` in this `prepareContentFolder`
  function, because it tries to create the folder if it doesn't exist
- it turns out we're using the asynchronous `fs.ensureDir` without an
  await just before, so it doesn't block on creating the folder
- there's a veeeery small window where the code within `copySync` thinks
  the folder doesn't exist, `ensureDir` creates the folder, and
  then `copySync` tries to create the folder => 💥
- it looks like we're already `await`-ing `prepareContentFolder`, so we
  can just switch all the calls to the Promise-based ones and await them
- the other `prepareContentFolder` uses the sync versions of the
  functions, but we can fix that in the future: 7b7767d483/ghost/core/test/utils/e2e-utils.js (L73-L79)
2022-07-26 17:28:16 +02:00
..
e2e-api Added content paywall for newsletters (#15048) 2022-07-26 19:16:08 +05:30
e2e-browser Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
e2e-frontend Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
e2e-server Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
e2e-webhooks Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
integration 🏗 Added jobs table creation migration 2022-07-22 23:32:58 +12:00
regression Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
unit Added content paywall for newsletters (#15048) 2022-07-26 19:16:08 +05:30
utils Fixed random test failure due to asynchronous directory creation 2022-07-26 17:28:16 +02:00
.eslintignore Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00
.eslintrc.js Converted Ghost repo into a monorepo 2022-07-20 16:41:05 +02:00