Skip to content

Commit

Permalink
added coverage support
Browse files Browse the repository at this point in the history
  • Loading branch information
Dante-101 committed Apr 24, 2018
1 parent 199c3e3 commit ded6598
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist/
.DS_Store
*.log
*.log
coverage
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ node_js :
install:
- npm install
script:
- npm test
- npm test

# Send coverage data to Coveralls
after_script: "cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js"
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# redux-persist-transform-compress-encrypt

[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![Build Status](https://travis-ci.org/Dante-101/redux-persist-transform-compress-encrypt.svg?branch=master)](https://travis-ci.org/Dante-101/redux-persist-transform-compress-encrypt)

To persist a compressed and encrypted Redux store

The package creates a transformer for redux-persist. The transformer stringifies the inbound state, compresses it using [`lz-string`](https://github.com/pieroxy/lz-string) and encrypts the compressed string with AES.
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"types": "dist/index.d.ts",
"scripts": {
"test": "mocha ./test/test.js",
"cover": "istanbul cover node_modules/mocha/bin/_mocha test/*.js -- -R spec",
"clean": "rimraf dist",
"prebuild": "npm run clean",
"build": "tsc",
Expand All @@ -32,6 +33,8 @@
"@types/mocha": "^5.2.0",
"@types/react": "^16.3.12",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"istanbul": "^0.4.5",
"mocha": "^5.1.1",
"react": "^16.3.2",
"redux": "^4.0.0",
Expand Down
5 changes: 2 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const createCompressEncryptTransform = require('../dist/index.js').default

describe('redux persist transform ', () => {
const secretKey = 'sample test key 1'
const onError = () => {
expect.fail("there should not be any error")
const onError = (e) => {
expect.fail(e, undefined, "unexpected error: " + e.message)
}

const transform = createCompressEncryptTransform({ secretKey: secretKey, onError })
Expand Down Expand Up @@ -78,5 +78,4 @@ describe('redux persist transform ', () => {
const reconstructedState = newTransform.out(persistString)
expect(reconstructedState).to.not.exist
})

})

0 comments on commit ded6598

Please sign in to comment.