Skip to content

ENOENT: no such file or directory, rename '.test-db.json.tmp' -> 'test-db.json' v7.0.1 #610

@axi92

Description

@axi92

V: 7.0.1
Its on windows 11, I havent tested it on ubuntu. I have read that it has to do something with antivirus on win? I am only using the default defender...
It helps when I delete the db file before starting the test.

I checked in my repo if somebody wants to try it as well?
https://github.com/axi92/project_isamap/tree/feature/backend-nestjs
branch: feature/backend-nestjs
Commit: 00cbb15f52cfc26ffab63f561e76e6e473df0b7f

Just go into the folder backend install the deps with npm i and run the tests npm run test

My output looks like this:

> project-isamap@0.0.1 test
> jest

 PASS  src/user/user.service.spec.ts
 PASS  src/auth/auth.service.spec.ts
[Nest] 8356  - 31.05.2025, 18:20:15   ERROR [ConfigurationService] Config was not loaded at all!
 PASS  src/configuration/configuration.service.spec.ts
 PASS  src/server/server.service.spec.ts                                                                                                                                                                                                          
 PASS  src/server/server.controller.spec.ts
 FAIL  src/lowdb/lowdb.service.spec.ts (7.78 s)
  ● LowdbService › should create a server for an existing user

    ENOENT: no such file or directory, rename 'D:\Git\NestWithVue\backend\.test-db.json.tmp' -> 'D:\Git\NestWithVue\backend\test-db.json'

      51 |     if (listEntries.servers.length < 1) {
      52 |       // If there are no entries read than the db is not there or empty so create one.
    > 53 |       await this.db.write();
         |       ^
      54 |     }
      55 |     this.logger.log("DB initiated!");
      56 |   }

      at ../node_modules/steno/lib/index.js:55:17
      at retryAsyncOperation (../node_modules/steno/lib/index.js:14:20)
      at Writer.#write (../node_modules/steno/lib/index.js:54:13)
      at LowWithLodash.write (../node_modules/lowdb/lib/core/Low.js:22:13)
      at LowdbService.initDatabase (lowdb/lowdb.service.ts:53:7)
      at LowdbService.onModuleInit (lowdb/lowdb.service.ts:32:5)
      at Object.<anonymous> (lowdb/lowdb.service.spec.ts:20:5)

Test Suites: 1 failed, 5 passed, 6 total
Tests:       1 failed, 17 passed, 18 total
Snapshots:   0 total
Time:        8.755 s
Ran all test suites.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions