yarn test

yarn test

Runs the test script defined by the package.

yarn test

If you have defined a scripts object in your package, this command will run the specified test script.

For example, if you have a bash script in your package, scripts/test:

#!/bin/bash

echo "Hello, world!"

and the following in your package.json:

{
  "name": "my-tribute-package",
  "version": "1.0.0",
  "description": "This is not the best package in the world, this is just a tribute.",
  "main": "index.js",
  "author": "Yarn Contributor",
  "license": "MIT",
  "scripts": {
    "test": "scripts/test"
  }
}

then running yarn test would yield:

$ yarn test
yarn test v0.15.1
$ "./scripts/test"
Hello, world!
✨ Done in 0.17s.

yarn run test

yarn test is also a shortcut for yarn run test.

© 2016–2017 Yarn Contributors
Licensed under the BSD License.
https://yarnpkg.com/en/docs/cli/test

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部