bharathnayak03 / svg-wc-icons

Generate WebComponents from svg icons
11 stars 1 forks source link

[testing] Visual testing with percy. #15

Open itaditya opened 4 years ago

itaditya commented 4 years ago

One process of testing everything works fine-

  1. Have a script like
# generate WC in different folders with varying usage of CLI tool.
node src/cli.js --src './test/svg_files/basic_usage' --dest './test/demo/gen_wc/basic_usage'
node src/cli.js --src './test/svg_files/prefix_suffix_usage' --dest './test/demo/gen_wc/prefix_suffix_usage'

# In the end
npm run snapshot
  1. The demo folder would have an index.html file which would be using all the generated web components in various ways.

  2. Using percy command line tool we can then generate snapshot of the entire page rendered by index.html.

Note- percy CLI doesn't need any testing framework like jest or cypress, it runs on its own and needs no code to be written.

bharathnayak03 commented 4 years ago

yeah visual testing is a good idea for tools like this