Skip to content

Commit c474249

Browse files
authored
Ensure watcher snapshot is written to correct FS (#15)
1 parent 0d6dfc8 commit c474249

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

packages/core/core/src/RequestTracker.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ export default class RequestTracker {
15101510
let opts = getWatcherOptions(this.options);
15111511
let snapshotPath = path.join(this.options.cacheDir, snapshotKey + '.txt');
15121512

1513-
await this.options.inputFS.writeSnapshot(
1513+
await this.options.outputFS.writeSnapshot(
15141514
this.options.watchDir,
15151515
snapshotPath,
15161516
opts,

packages/core/core/test/TargetRequest.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,7 @@ describe('TargetResolver', () => {
12431243
[
12441244
{
12451245
name: 'default',
1246-
distDir: '.atlaspack-cache/dist',
1246+
distDir: serveDistDir,
12471247
publicUrl: '/',
12481248
env: {
12491249
id: 'd6ea1d42532a7575',

packages/core/core/test/test-utils.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import type {Environment, AtlaspackOptions, Target} from '../src/types';
55
import {DEFAULT_FEATURE_FLAGS} from '@atlaspack/feature-flags';
66
import {FSCache} from '@atlaspack/cache';
77
import tempy from 'tempy';
8-
import path from 'path';
98
import {inputFS, outputFS} from '@atlaspack/test-utils';
109
import {relativePath} from '@atlaspack/utils';
1110
import {NodePackageManager} from '@atlaspack/package-manager';
@@ -17,7 +16,7 @@ export let cache: FSCache = new FSCache(outputFS, cacheDir);
1716
cache.ensure();
1817

1918
export const DEFAULT_OPTIONS: AtlaspackOptions = {
20-
cacheDir: path.join(__dirname, '.atlaspack-cache'),
19+
cacheDir,
2120
atlaspackVersion: '',
2221
watchDir: __dirname,
2322
watchIgnore: undefined,

packages/core/integration-tests/test/atlaspack-query.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
// @flow
22
import assert from 'assert';
33
import path from 'path';
4-
import {bundle, describe, fsFixture, overlayFS} from '@atlaspack/test-utils';
4+
import {
5+
bundle,
6+
describe,
7+
fsFixture,
8+
overlayFS,
9+
inputFS,
10+
} from '@atlaspack/test-utils';
511
import {loadGraphs} from '../../../dev/query/src';
612

713
describe.v2('atlaspack-query', () => {
8-
it.skip('loadGraphs', async function () {
14+
it('loadGraphs', async function () {
915
let entries = 'index.js';
1016
let options = {
1117
mode: 'production',
@@ -14,6 +20,9 @@ describe.v2('atlaspack-query', () => {
1420
},
1521
shouldDisableCache: false,
1622
inputFS: overlayFS,
23+
// We need to write to the default inputFS (NodeFS) as `loadGraphs` doesn't
24+
// support custom FS's
25+
outputFS: inputFS,
1726
cacheDir: path.join(__dirname, '.atlaspack-cache'),
1827
};
1928

packages/core/integration-tests/test/cache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3532,7 +3532,7 @@ describe.v2('cache', function () {
35323532
assert(!res.includes('BAR'));
35333533
});
35343534

3535-
describe('pnp', function () {
3535+
describe.skip('pnp', function () {
35363536
it('should invalidate when the .pnp.js file changes', async function () {
35373537
let Module = require('module');
35383538
let origPnpVersion = process.versions.pnp;

0 commit comments

Comments
 (0)