Skip to content

Commit

Permalink
Delete require cache to support --watch.
Browse files Browse the repository at this point in the history
Without clearing the cache no file changes are detected.
  • Loading branch information
elyobo committed Jun 14, 2019
1 parent 95832d7 commit 32f47f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ const loadConfig = testPath =>
// Run tests on a given file
const run = ({ testPath, config, globalConfig }) => {
const schema = require(testPath)

// Avoid caching for `--watch` mode
delete delete require.cache[require.resolve(testPath)]

const test = {
path: testPath,
title: 'OAS Linter'
Expand Down

0 comments on commit 32f47f4

Please sign in to comment.