eslint / create-config

Utility to create ESLint config files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

add some e2e tests

aladdin-add opened this issue · comments

the test coverage (based on the commit 2305c83):

------------------------|---------|----------|---------|---------|----------------------------------
File                    | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                
------------------------|---------|----------|---------|---------|----------------------------------
All files               |   73.38 |    88.99 |   80.76 |   73.38 |                                  
 init                   |   73.08 |    88.78 |    87.5 |   73.08 |                                  
  config-file.js        |     100 |     90.9 |     100 |     100 | 47,112                           
  config-initializer.js |   56.76 |     84.9 |   72.72 |   56.76 | ...4-275,306-335,342-541,547-549 
  npm-utils.js          |     100 |    93.75 |     100 |     100 | 57,100                           
 shared                 |      84 |      100 |       0 |      84 |                                  
  logging.js            |      84 |      100 |       0 |      84 | 15-16,24-25                      
------------------------|---------|----------|---------|---------|----------------------------------

the coverage is not very high as it does not test users input. I was thinking of writing an e2e test runner to support something like:

const configs = [
{
  desc: "",
  input: [""], // to simulate user input
  validate: function () {
     assert(...) // to verify the output, generated config
  }
},
]

run(configs);

the config's each item means a user input & its output (will be cleaned after running). Let me know what you think. :)

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.