diff --git a/__tests__/engines.test.js b/__tests__/engines.test.js new file mode 100644 index 0000000..9a3ed11 --- /dev/null +++ b/__tests__/engines.test.js @@ -0,0 +1,20 @@ +'use strict'; + +const { execFileSync } = require('child_process'); +const pkg = require('../package.json'); + +describe('engines.node', () => { + it("is the same as stylelint's one", () => { + const stylelintVersion = pkg.peerDependencies.stylelint; + const [nodeVersion] = JSON.parse( + execFileSync('npm', [ + 'view', + '--json', + `stylelint@${stylelintVersion}`, + 'engines.node', + ]).toString(), + ); + + expect(nodeVersion).toEqual(pkg.engines.node); + }); +}); diff --git a/package-lock.json b/package-lock.json index f0f8b3d..35c62b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,9 @@ "remark-cli": "^11.0.0", "stylelint": "^15.8.0" }, + "engines": { + "node": "^14.13.1 || >=16.0.0" + }, "peerDependencies": { "stylelint": "^15.5.0" } diff --git a/package.json b/package.json index e2bede1..66b3190 100644 --- a/package.json +++ b/package.json @@ -66,5 +66,8 @@ }, "peerDependencies": { "stylelint": "^15.5.0" + }, + "engines": { + "node": "^14.13.1 || >=16.0.0" } }