Skip to content

Commit

Permalink
tests: revert order
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianRomanski committed Jan 3, 2025
1 parent 31e094b commit 138d786
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions projects/nx-verdaccio/src/plugin/caching.unit-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ describe('readTargetsCache', (): void => {

it('should call existSync once with correct argument', (): void => {
readTargetsCache(path);
expect(existsSyncSpy).toHaveBeenCalledWith(path);
expect(existsSyncSpy).toHaveBeenCalledTimes(1);
expect(existsSyncSpy).toHaveBeenCalledWith(path);
});

it('should call readJsonFile once with correct argument', (): void => {
readTargetsCache(path);
expect(readJsonFileSpy).toHaveBeenCalledWith(path);
expect(readJsonFileSpy).toHaveBeenCalledTimes(1);
expect(readJsonFileSpy).toHaveBeenCalledWith(path);
});

it('should return target cache if existsSync returns true, and NX_CACHE_PROJECT_GRAPH = true', (): void => {
Expand Down Expand Up @@ -150,8 +150,8 @@ describe('writeTargetsToCache', (): void => {
it('should call writeJsonFile once with correct arguments if process.env.NX_CACHE_PROJECT_GRAPH !== false', (): void => {
process.env.NX_CACHE_PROJECT_GRAPH = 'true';
writeTargetsToCache(path, MOCK_TARGETS_CACHE);
expect(writeJsonFile).toHaveBeenCalledWith(path, MOCK_TARGETS_CACHE);
expect(writeJsonFile).toHaveBeenCalledTimes(1);
expect(writeJsonFile).toHaveBeenCalledWith(path, MOCK_TARGETS_CACHE);
});

it('should not call writeJsonFile if process.env.NX_CACHE_PROJECT_GRAPH == false', (): void => {
Expand Down

0 comments on commit 138d786

Please sign in to comment.