Closed savetheclocktower closed 2 years ago
We can setup GitHub Action workflows for the different setups. If we have some tests we only want to run in CI we can use process.env.CI
.
something like:
if (process.env.CI) {
describe('CI tests' () => {
...
}
);
}
Certain tests we could run would require installing actual software into specific locations, thus are unfeasible to run on contributors' machines. If someone could figure out how to set up a CI server with the necessary environment, I could write the tests.
Testing
nodeBin
behaviorThis would involve installing various versions of Node into known locations.
Install three different versions of Node:
Set
nodeBin
to the LTS version via package settingsOpen a project with ESLint v8 or greater
Create a
.linter-eslint
file with{ "nodeBin": "[path to bleeding-edge node]" }
.linter-eslint
file; wait a few secondsModify the
.linter-eslint
file to read{ "nodeBin": "[path to too-old node]" }
.linter-eslint
file; wait a few secondsDelete our
.linter-eslint
fileChange the node path in package settings via
atom.config.set
to bleeding-edgeChange the node path in package settings to something nonexistent
Testing behavior with various ESLint versions
We read ESLint's
package.json
to figure out what version we're dealing with. So to write specs against this behavior, we'd have to have at least three different dummy projects, each of which installs a different version of ESLint:Things to test:
Open the v8-or-greater version with
linter-eslint
package installed, butlinter-eslint-node
disabledOpen the v8-or-greater version with
linter-eslint
package enabled andlinter-eslint-node
enabledlinter-eslint-node
as handling the linting for this projectOpen the v7 project with
linter-eslint
disabledlinter-eslint-node
lints as expectedOpen the v7 project with
linter-eslint
enabledlinter-eslint
as handling the linting for this projectlinter-eslint-node
doesn't try to lint; explicitly callingprovideLinter().lint
should produce zero results, even on a file with a syntax errorOpen the <v7 project with
linter-eslint
disabledlinter-eslint
linter-eslint-node
doesn't try to lint; explicitly callingprovideLinter().lint
should produce zero results, even on a file with a syntax errorOpen the <v7 project with
linter-eslint
enabledlinter-eslint-node
doesn't try to lint; explicitly callingprovideLinter().lint
should produce zero results, even on a file with a syntax error