Skip to content

Commit

Permalink
Fixed failing tests/build
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanSobey committed Jan 26, 2021
1 parent e6359c5 commit 01eb726
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node-version: ['14.x']
node-version: ['12.x']
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export class ChartJSNodeCanvas {
delete require.cache[require.resolve(plugin)];
}
}
delete require.cache[require.resolve('chart.js')];

if (plugins?.globalVariableLegacy) {
(global as any).Chart = chartJs;
Expand Down Expand Up @@ -250,6 +249,9 @@ export class ChartJSNodeCanvas {
if (chartCallback) {
chartCallback(chartJs);
}

delete require.cache[require.resolve('chart.js')];

return chartJs;
}

Expand Down

0 comments on commit 01eb726

Please sign in to comment.