Browse Source

Add babel

pull/2/head
Luke Childs 9 years ago
parent
commit
b98a76045a
  1. 1
      .gitignore
  2. 1
      .npmignore
  3. 21
      package.json
  4. 2
      test/unit.js

1
.gitignore

@ -1,2 +1,3 @@
node_modules node_modules
.nyc_output .nyc_output
dist

1
.npmignore

@ -0,0 +1 @@
src

21
package.json

@ -2,10 +2,24 @@
"name": "node-browser-environment", "name": "node-browser-environment",
"version": "1.0.2", "version": "1.0.2",
"description": "Simulates a global browser environment using jsdom", "description": "Simulates a global browser environment using jsdom",
"main": "src/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"prebuild": "rm -rf dist",
"build": "babel -d dist src",
"prebuild:map": "npm run prebuild",
"build:map": "babel --source-maps=true -d dist src",
"pretest": "npm run build:map",
"test": "nyc ava test", "test": "nyc ava test",
"coverage": "nyc report --reporter=text-lcov | coveralls" "coverage": "nyc report --reporter=text-lcov | coveralls",
"prepublish": "npm run build"
},
"babel": {
"presets": [
"es2015"
],
"plugins": [
"add-module-exports"
]
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -29,6 +43,9 @@
}, },
"devDependencies": { "devDependencies": {
"ava": "^0.14.0", "ava": "^0.14.0",
"babel-cli": "^6.9.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-preset-es2015": "^6.9.0",
"coveralls": "^2.11.9", "coveralls": "^2.11.9",
"nyc": "^6.4.4" "nyc": "^6.4.4"
} }

2
test/unit.js

@ -1,5 +1,5 @@
import test from 'ava'; import test from 'ava';
import browserEnv from '../src'; import browserEnv from '../dist';
test('Function should setup browser environment', t => { test('Function should setup browser environment', t => {
t.is(typeof window, 'undefined'); t.is(typeof window, 'undefined');

Loading…
Cancel
Save