Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade rollup, prep new release #92

Merged
merged 3 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
{
"presets": [
[
"env",
{
"targets": {
"node": "6.11.3"
}
["@babel/preset-env", {
"targets": {
"node": "6.14.0",
}
]
]
}]
],
}
4 changes: 2 additions & 2 deletions __tests__/setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ describe('setup', () => {

['_localStorage', '_sessionStorage'].forEach(gKey => {
it(`[${gKey}] should define a property on the global object with writable false`, () => {
require('../src/setup');
require('../src/setup');
expect(global[gKey.replace('_', '')].constructor.name).toBe(
'LocalStorage'
);
});

it(`[${gKey}] should define a property on the global object with writable false`, () => {
global[gKey] = true;
require('../src/setup');
require('../src/setup');
let e;
try {
global[`_${gKey.replace('_', '')}`] = 'blah';
Expand Down
13 changes: 9 additions & 4 deletions dist/setup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/setup.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,19 @@
},
"dependencies": {},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-jest": "^23.4.2",
"babel-plugin-external-helpers": "^6.22.0",
"babel-preset-env": "^1.6.1",
"eslint": "^4.10.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-prettier": "^2.3.1",
"jest": "^23.4.2",
"@babel/core": "^7.1.2",
"@babel/plugin-external-helpers": "^7.0.0",
"@babel/preset-env": "^7.1.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "*",
"jest": "*",
"prettier": "^1.8.2",
"rollup": "^0.66.0",
"rollup-plugin-babel": "^4.0.2",
"rollup": "^0.66.6",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-node-resolve": "^3.0.0"
},
"engines": {
"node": ">=6.11.3"
"node": ">=6.14.0"
},
"jest": {
"testURL": "http://localhost/",
Expand Down
12 changes: 0 additions & 12 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ export default {
babel({
exclude: 'node_modules/**',
babelrc: false,
presets: [
[
'env',
{
targets: {
node: '6.11.3',
},
modules: false,
},
],
],
plugins: ['external-helpers'],
}),
],
output: {
Expand Down
14 changes: 7 additions & 7 deletions src/setup.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { LocalStorage } from "./localstorage";
import { LocalStorage } from './localstorage';

if (typeof global._localStorage !== "undefined") {
Object.defineProperty(global, "_localStorage", {
if (typeof global._localStorage !== 'undefined') {
Object.defineProperty(global, '_localStorage', {
value: new LocalStorage(jest),
writable: false
writable: false,
});
} else {
global.localStorage = new LocalStorage(jest);
}

if (typeof global._sessionStorage !== "undefined") {
Object.defineProperty(global, "_sessionStorage", {
if (typeof global._sessionStorage !== 'undefined') {
Object.defineProperty(global, '_sessionStorage', {
value: new LocalStorage(jest),
writable: false
writable: false,
});
} else {
global.sessionStorage = new LocalStorage(jest);
Expand Down
Loading