Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mellyeliu committed Jan 13, 2025
2 parents 55d4190 + 65ae1f3 commit 8710eb4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/cli/__tests__/compile-stylex-folder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@ describe('CLI works with a custom cache path', () => {
config.cachePath = customCachePath;

beforeEach(async () => {
writeSpy2 = jest.spyOn(cacheModule, 'writeCache');
writeSpy = jest.spyOn(cacheModule, 'writeCache');
});

afterEach(() => {
writeSpy2.mockRestore();
writeSpy.mockRestore();
});

afterAll(async () => {
Expand Down Expand Up @@ -393,14 +393,13 @@ describe('CLI works with a custom cache path', () => {
expect(cacheData).toHaveProperty('inputHash');
expect(cacheData).toHaveProperty('outputHash');
expect(cacheData).toHaveProperty('collectedCSS');

});
test('skips transformation when cache is valid', async () => {
await compileDirectory(config);

// Ensure no additional writes were made due to no file changes
expect(writeSpy2).toHaveBeenCalledTimes(0);
writeSpy2.mockRestore();
expect(writeSpy).toHaveBeenCalledTimes(0);
writeSpy.mockRestore();

const customFilePath = path.join(config.input, 'index.js');

Expand Down

0 comments on commit 8710eb4

Please sign in to comment.