Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.
Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules
flag.
Install cross-env
:
There are seemingly a few incompatibilities with Vue and Istanbul/nyc at the moment, making it a bit difficult to set up proper coverage reporting for Vue files. Thankfully, there's a relatively easy way to fix that!
This will walk you through everything you need to do to add tests and coverage reporting to your vue-cli based project.
Install dependencies for testing and coverage reporting
yarn add -D @vue/cli-plugin-unit-mocha @vue/test-utils istanbul-instrumenter-loader nyc
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
<!-- A scaffolded edit view converted to mustache --> | |
<h1>Editing post</h1> | |
{{#form}} | |
{{#errors?}} | |
<div id="error_explanation"> | |
<h2>{{error_header}}</h2> | |
</div> | |
<ul> |