-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
…tchers so it can be tested as a first pass
|
Copying in people for review and comments @finnlewis @Adnan-cds @cjstevens78 @andybroomfield |
|
|
||
| strategy: | ||
| matrix: | ||
| node-version: [10.x] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. I have never tried this "matrix" feature :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's quite nice, should allow us to just add other node version we want to test in that list
|
|
||
|
|
||
| function runCommand(command) { | ||
| execSync(command); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for code readability.
Adnan-cds
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having never used Mocha.js, I am not the best person to review this code :( I have just one final comment about the structure of the code rather than the substance.
There are lots of file and directory existent checks through the checkFileExists() and checkDirectoryExists() functions. I was wondering if we could stash all the file and Directory names into an array and then pass that array to an existence check function. That function can then be called once from it(). I understand this will make the error message less precise, but it will result in a lot less code while giving enough indication of where the problem lies. Sample code (totally untested):
describe('FILL ME IN.', () => it('AGAIN, FILL ME IN.', done => {
const filesAndDirsToCheck = ['./assets', './assets/css', './templates', './and/so/on']
assert(checkFileOrDirExists(filesAndDirsToCheck))
done()
}))
|
Thanks @Adnan-cds I'll make some code changes. On the verbosity of the code, part of it was simplicity in writing but another part as you said is getting that report back. I just thought of it as checkbox ticking and feel that currently it's not entirely a bad thing. I'm happy to change it but my thinking was for this to be similar to behat tests in that sense. @cjstevens78 do you have a moment to review this PR as well please? |
|
Merging for now, can review. |
What this PR does:
Renames existing tests to DrupalUnitTests so it's more descriptive under the checks tab
Adds new theme tests that are run using Mocha.js testing for compilation
Creates a new command for gulp and npm for generating files without any watchers (for now) and for testing.
npm testwill run some default tests checking that the theme structure is all good and compilation worksIt currently tests only on Node 10.x but we can extend that for other node versions. You can view the output here.
Tests sit in
tests/health-check.test.jsFull output of
npm testornpm run health-check