Browse Source

Use Jest instead jasmine-node for testing

master
Dmitry Karpunin 5 years ago
parent
commit
8f5ea1de52
  1. 2
      .gitignore
  2. 6
      README.md
  3. 6
      README_CN.md
  4. 4791
      package-lock.json
  5. 17
      package.json
  6. 6
      spec/px-to-viewport.spec.js

2
.gitignore

@ -4,4 +4,4 @@ logs
npm-debug.log*
node_modules
.idea
postcss-px-to-em-master
yarn.lock

6
README.md

@ -161,7 +161,7 @@ add to your `postcss.config.js`
```js
module.exports = {
plugins: {
...
// ...
'postcss-px-to-viewport': {
// options
}
@ -171,9 +171,9 @@ module.exports = {
## Running the tests
In order to run tests, you need to install `jasmine-node` globally:
In order to run tests, you need to install dev-packages:
```
$ npm install jasmine-node -g
$ npm install
```
Then run the tests via npm script:
```

6
README_CN.md

@ -161,7 +161,7 @@ gulp.task('css', function () {
```js
module.exports = {
plugins: {
...
// ...
'postcss-px-to-viewport': {
// options
}
@ -171,9 +171,9 @@ module.exports = {
## 测试
为了跑测试案例, 你需要全局安装 `jasmine-node` :
为了跑测试案例,您需要安装开发套件:
```
$ npm install jasmine-node -g
$ npm install
```
然后输入下面的命令:
```

4791
package-lock.json
File diff suppressed because it is too large
View File

17
package.json

@ -11,12 +11,6 @@
"bugs": "https://github.com/evrone/postcss-px-to-viewport/issues",
"homepage": "https://github.com/evrone/postcss-px-to-viewport",
"main": "index.js",
"scripts": {
"test": "jasmine-node spec"
},
"devDependencies": {
"jasmine-node": "~1.11.0"
},
"keywords": [
"css",
"units",
@ -30,8 +24,17 @@
"postcss",
"postcss-plugin"
],
"scripts": {
"test": "jest spec/*.spec.js"
},
"dependencies": {
"object-assign": ">=4.0.1",
"object-assign": ">=4.0.1"
},
"devDependencies": {
"jest": "^25.4.0",
"postcss": ">=5.0.2"
},
"peerDependencies": {
"postcss": ">=5.0.2"
}
}

6
spec/px-to-viewport.spec.js

@ -1,11 +1,9 @@
// Jasmine unit tests
// To run tests, run these commands from the project root:
// 1. `npm install -g jasmine-node`
// 2. `jasmine-node spec`
// 1. `npm install`
// 2. `npm test`
/* global describe, it, expect */
'use strict';
var postcss = require('postcss');
var pxToViewport = require('..');
var basicCSS = '.rule { font-size: 15px }';

Loading…
Cancel
Save