Conversation
theoludwig
left a comment
There was a problem hiding this comment.
Thanks for your contribution! @JoeVanKessel
Could you explain a little bit more why this change would be useful, compared to the current tests we currently have ?
| @@ -0,0 +1,221 @@ | |||
| function getPossibleExpressions(expressionType, count) { | |||
| const data = require('../data/expressions/en.json') | |||
There was a problem hiding this comment.
You should not use the CJS require syntax, instead use the ESM import.
| return data.todolist.view_lists.expressions | ||
| case "view list": | ||
| return data.todolist.view_list.expressions | ||
| case "rename list": |
There was a problem hiding this comment.
Instead to return the same things for multiple values of expressionType, you can do something like that :
case "view lists":
case "view list":
return data.todolist.view_list.expressions| const fs = require('fs') | ||
| const path = require('path') |
There was a problem hiding this comment.
Instead to use the CJS require syntax, use the ESM import at the top of the file.
| function getOutputs(){ | ||
| const fs = require('fs') | ||
| const path = require('path') | ||
| let data = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../data/db/calendar.spec.json'))) |
There was a problem hiding this comment.
You should not use let if you don't redeclare the variable, instead use const.
Also instead to use fs.readFileSync, use the promises based API instead, like fs.promises.readFile and you can create a new variable to store path.resolve(__dirname, '../data/db/calendar.spec.json')), it will probably be clearer. 👍
|
|
||
| async function testCreateListExpressions(count) { | ||
| const expression = getPossibleExpressions("create list")[count] | ||
| var quote = '\"' |
There was a problem hiding this comment.
You should not use var, instead use let or const.
| } | ||
| } | ||
|
|
||
| function createObjs(){ |
There was a problem hiding this comment.
Prefer explicit than implicit, so instead you could call this function createObjects.
Also it doesn't seems like this function "only" create objects, it actually creates todos/lists objects, so be more explicit of what the function does in its name.
What type of change does this PR introduce?
Does this PR introduce breaking changes?
List any relevant issue numbers:
Description:
I more thorough test suite for the todo list module. This test suite focuses on scalability, so any number of tests can easily be created for a given module.