Can't Get Strapi Unit Tests to Run

System Information
  • Strapi Version: “4.15.5”
  • Operating System: Mac OS
  • Database: sqlite3

I’ve been following a mixture of these docs, this example, and other community posts in order to get a Strapi instance running for unit testing.

The current error I’m encountering is:

    Middleware "strapi::session": App keys are required. Please set app.keys in config/server.js (ex: keys: ['myKeyA', 'myKeyB'])

      39 |   if (!instance) {
      40 |     /** the follwing code in copied from `./node_modules/strapi/lib/Strapi.js` */
    > 41 |     await Strapi().load();
         |     ^
      42 |     await waitForServer();
      43 |
      44 |     instance = strapi; // strapi is global now

I am providing keys from config/server.ts:

app: {
    keys: env.array("APP_KEYS"),

and I have ensured the keys are present in my .env file.

The documentation and the examples I’ve seen seem to be multiple years old and out of date. Is there any updated documentation that explains this process more clearly?