Skip to content

Commit

Permalink
Add test that we can disable tracking with option
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed Sep 4, 2020
1 parent d9fe9cb commit 322e2a6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,17 @@ describe('dependencies parse', function() {
expect.stringMatching(/fixtures[\/\\]invalid\.xml/)
]));
});

test("shouldn't add dependencies when 'trackDependencies' false", async function() {
const fixturePath = path.resolve('test/fixtures/with-dependencies.xml');
const source = await readFile(fixturePath, 'utf8');
const {context, result} = getLoaderContext(fixturePath, {
trackDependencies: false
});
loader.call(context, source);

await result;

expect(context.addDependency).not.toHaveBeenCalled();
});
});

0 comments on commit 322e2a6

Please sign in to comment.