Skip to content

Commit 9eee21e

Browse files
authored
Merge pull request #2 from javierbrea/v1.0.0
V1.0.0
2 parents 75a3e73 + 1fa01bd commit 9eee21e

16 files changed

+4801
-569
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ addons:
1919
script:
2020
- npm run lint
2121
- npm run test
22-
# - npm run check-coverage
2322
- npm run coveralls
2423
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi'
2524

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
### Removed
1212
### BREAKING CHANGES
1313

14+
## [1.0.0] - 2019-10-26
15+
### Added
16+
- Add saveLocalStorage command
17+
- Add restoreLocalStorage command
18+
- Add clearLocalStorageSnapshot command
19+
1420
## [1.0.0-alpha.1] - 2019-10-26
1521
### Added
1622
- Add package structure.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
Extends Cypress' cy commands with localStorage methods. Allows preserving localStorage between tests.
1010

11-
> IMPORTANT NOTE: Current alpha version is not functional. This package is still in development.
12-
1311
## The problem
1412

1513
You want to preserve localStorage between Cypress tests.
@@ -39,13 +37,16 @@ import 'cypress-localstorage-commands'
3937
You can now use all next commands:
4038

4139
```js
42-
cy.localStorageSave() // Save current localStorage values
40+
cy.saveLocalStorage() // Save current localStorage values into an internal "snapshot"
4341
```
4442

4543
```js
46-
cy.localStorageRestore() // Restore localStorage to previously saved values
44+
cy.restoreLocalStorage() // Restore localStorage to previously "snapshot" saved values
4745
```
4846

47+
```js
48+
cy.clearLocalStorageSnapshot() // Clear localStorage "snapshot" values
49+
```
4950

5051
## Contributing
5152

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
require("./src/register");
1+
/* global Cypress, localStorage */
2+
3+
const { register } = require("./src/register");
4+
5+
register(Cypress, localStorage);

jest.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// For a detailed explanation regarding each configuration property, visit:
2+
// https://jestjs.io/docs/en/configuration.html
3+
4+
module.exports = {
5+
// Automatically clear mock calls and instances between every test
6+
clearMocks: true,
7+
8+
// Indicates whether the coverage information should be collected while executing the test
9+
collectCoverage: true,
10+
11+
// An array of glob patterns indicating a set of files for which coverage information should be collected
12+
collectCoverageFrom: ["src/**"],
13+
14+
// The directory where Jest should output its coverage files
15+
coverageDirectory: "coverage",
16+
17+
// An object that configures minimum threshold enforcement for coverage results
18+
coverageThreshold: {
19+
global: {
20+
branches: 100,
21+
functions: 100,
22+
lines: 100,
23+
statements: 100
24+
}
25+
},
26+
27+
// The test environment that will be used for testing
28+
testEnvironment: "node",
29+
30+
// The glob patterns Jest uses to detect test files
31+
testMatch: ["**/test/**/*.spec.js"]
32+
};

0 commit comments

Comments
 (0)