mirror of
https://github.com/datashard/snapshot.git
synced 2024-12-22 01:47:35 +00:00
chore: initial code
This commit is contained in:
commit
4c605e4d49
9 changed files with 189 additions and 0 deletions
5
.eslintrc
Normal file
5
.eslintrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"extends": [
|
||||
"plugin:cypress-dev/general"
|
||||
]
|
||||
}
|
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
node_modules/
|
||||
.DS_Store
|
||||
npm-debug.log
|
4
.npmrc
Normal file
4
.npmrc
Normal file
|
@ -0,0 +1,4 @@
|
|||
registry=http://registry.npmjs.org/
|
||||
save-exact=true
|
||||
progress=false
|
||||
package-lock=false
|
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"standard.enable": false,
|
||||
"eslint.enable": true
|
||||
}
|
59
README.md
Normal file
59
README.md
Normal file
|
@ -0,0 +1,59 @@
|
|||
# @cypress/snapshot
|
||||
|
||||
> Adds value / object / DOM element snapshot testing support to Cypress test runner
|
||||
|
||||
[![NPM][npm-icon] ][npm-url]
|
||||
|
||||
[![Build status][ci-image] ][ci-url]
|
||||
[![semantic-release][semantic-image] ][semantic-url]
|
||||
|
||||
## Install
|
||||
|
||||
Requires [Node](https://nodejs.org/en/) version 6 or above.
|
||||
|
||||
```sh
|
||||
npm install --save-dev @cypress/snapshot
|
||||
```
|
||||
|
||||
## Use
|
||||
|
||||
### Small print
|
||||
|
||||
Author: Gleb Bahmutov <gleb@cypress.io> © 2017
|
||||
|
||||
License: MIT - do anything with the code, but don't blame u if it does not work.
|
||||
|
||||
Support: if you find any problems with this module, email / tweet /
|
||||
[open issue](https://github.com/cypress-io/snapshot/issues) on Github
|
||||
|
||||
## MIT License
|
||||
|
||||
Copyright (c) 2017 Cypress.io <gleb@cypress.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
[npm-icon]: https://nodei.co/npm/@cypress/snapshot.svg?downloads=true
|
||||
[npm-url]: https://npmjs.org/package/@cypress/snapshot
|
||||
[ci-image]: https://travis-ci.org/cypress-io/snapshot.svg?branch=master
|
||||
[ci-url]: https://travis-ci.org/cypress-io/snapshot
|
||||
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
||||
[semantic-url]: https://github.com/semantic-release/semantic-release
|
12
issue_template.md
Normal file
12
issue_template.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
Thank you for taking time to open a new issue. Please answer a few questions to help us fix it faster. You can delete text that is irrelevant to the issue.
|
||||
|
||||
## Is this a bug report or a feature request?
|
||||
|
||||
If this is a bug report, please provide as much info as possible
|
||||
|
||||
- version
|
||||
- platform
|
||||
- expected behavior
|
||||
- actual behavior
|
||||
|
||||
If this is a new feature request, please describe it below
|
85
package.json
Normal file
85
package.json
Normal file
|
@ -0,0 +1,85 @@
|
|||
{
|
||||
"name": "@cypress/snapshot",
|
||||
"description": "Adds value / object / DOM element snapshot testing support to Cypress test runner",
|
||||
"version": "1.0.0",
|
||||
"author": "Gleb Bahmutov <gleb@cypress.io>",
|
||||
"bugs": "https://github.com/cypress-io/snapshot/issues",
|
||||
"config": {
|
||||
"pre-git": {
|
||||
"commit-msg": "simple",
|
||||
"pre-commit": [
|
||||
"npm prune",
|
||||
"npm run deps",
|
||||
"npm test",
|
||||
"git add src/*.js",
|
||||
"npm run ban"
|
||||
],
|
||||
"pre-push": [
|
||||
"npm run unused-deps",
|
||||
"npm run secure",
|
||||
"npm run license",
|
||||
"npm run ban -- --all",
|
||||
"npm run size"
|
||||
],
|
||||
"post-commit": [],
|
||||
"post-merge": []
|
||||
}
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"files": [
|
||||
"src/*.js",
|
||||
"!src/*-spec.js"
|
||||
],
|
||||
"homepage": "https://github.com/cypress-io/snapshot#readme",
|
||||
"keywords": [
|
||||
"cypress",
|
||||
"cypress-io",
|
||||
"plugin",
|
||||
"snapshot",
|
||||
"testing"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "src/",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"registry": "http://registry.npmjs.org/"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/cypress-io/snapshot.git"
|
||||
},
|
||||
"scripts": {
|
||||
"ban": "ban",
|
||||
"deps": "deps-ok && dependency-check --no-dev .",
|
||||
"issues": "git-issues",
|
||||
"license": "license-checker --production --onlyunknown --csv",
|
||||
"lint": "eslint --fix src/*.js",
|
||||
"pretest": "npm run lint",
|
||||
"secure": "nsp check",
|
||||
"size": "t=\"$(npm pack .)\"; wc -c \"${t}\"; tar tvf \"${t}\"; rm \"${t}\";",
|
||||
"test": "npm run unit",
|
||||
"unit": "mocha src/*-spec.js",
|
||||
"unused-deps": "dependency-check --unused --no-dev ."
|
||||
},
|
||||
"release": {
|
||||
"analyzeCommits": "simple-commit-message"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ban-sensitive-files": "1.9.2",
|
||||
"dependency-check": "2.9.1",
|
||||
"deps-ok": "1.2.1",
|
||||
"eslint": "4.13.0",
|
||||
"eslint-plugin-cypress-dev": "1.1.2",
|
||||
"git-issues": "1.3.1",
|
||||
"license-checker": "15.0.0",
|
||||
"mocha": "4.0.1",
|
||||
"nsp": "3.1.0",
|
||||
"pre-git": "3.16.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"check-more-types": "2.24.0",
|
||||
"lazy-ass": "1.6.0"
|
||||
}
|
||||
}
|
5
src/index.js
Normal file
5
src/index.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
|
||||
module.exports = true
|
||||
|
12
src/snapshot-spec.js
Normal file
12
src/snapshot-spec.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
'use strict'
|
||||
|
||||
/* eslint-env mocha */
|
||||
const snapshot = require('.')
|
||||
const la = require('lazy-ass')
|
||||
const is = require('check-more-types')
|
||||
|
||||
describe('@cypress/snapshot', () => {
|
||||
it('is a function', () => {
|
||||
la(is.fn(snapshot))
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue