diff --git a/.eslintignore b/.eslintignore index a261f291755..15caa4d6118 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ dist/* +test/integration/react-browser/* diff --git a/test/integration/integration-test.cjs b/test/integration/integration-test.cjs index 1d841cc6a18..560cde977c6 100644 --- a/test/integration/integration-test.cjs +++ b/test/integration/integration-test.cjs @@ -7,6 +7,11 @@ const childProcess = require('child_process'); const {describe, it} = require('mocha'); +const platforms = [ + 'node', + 'react-browser' +]; + function exec(command, options = {}) { const output = childProcess.execSync(command, { encoding: 'utf-8', @@ -27,7 +32,7 @@ describe('Integration Tests', () => { path.join(tmpDir, 'package.tgz'), ); - function testOnNodeProject(projectName) { + function testProjectOnPlatform(projectName) { const projectPath = path.join(__dirname, projectName); const packageJSONPath = path.join(projectPath, 'package.json'); @@ -42,5 +47,7 @@ describe('Integration Tests', () => { }).timeout(5 * 60 * 1000); } - testOnNodeProject('node'); + for (const platform of platforms) { + testProjectOnPlatform(platform) + } }); diff --git a/test/integration/react-browser/package.json b/test/integration/react-browser/package.json new file mode 100644 index 00000000000..b8a131f4d6a --- /dev/null +++ b/test/integration/react-browser/package.json @@ -0,0 +1,26 @@ +{ + "private": true, + "description": "chart.js should work in react-browser (Web)", + "dependencies": { + "chart.js": "file:../package.tgz", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-scripts": "5.0.1", + "web-vitals": "^2.1.4" + }, + "scripts": { + "test": "react-scripts build" + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } +} diff --git a/test/integration/react-browser/public/index.html b/test/integration/react-browser/public/index.html new file mode 100644 index 00000000000..3051d247d8e --- /dev/null +++ b/test/integration/react-browser/public/index.html @@ -0,0 +1,36 @@ + + +
+ + + + + +