forked from auth0/lock
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define basic scripts and dependencies
- Loading branch information
1 parent
34be235
commit f44e999
Showing
8 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "lock-refactor", | ||
"version": "0.0.0", | ||
"main": "src/main.js", | ||
"license": "MIT", | ||
"browserify": { | ||
"transform": [ | ||
[ | ||
"babelify", | ||
{ | ||
"blacklist": [ | ||
"regenerator" | ||
] | ||
} | ||
] | ||
] | ||
}, | ||
"scripts": { | ||
"start": "npm run build && serve .", | ||
"build": "browserify --extension=.jsx --extension=.js src/main.js | uglifyjs > build/build.js", | ||
"watch": "watchify --extension=.jsx --extension=.js src/main.js -o build/build.js --debug --verbose & serve .", | ||
"test": "mochify --recursive --extension=.jsx --extension=.js", | ||
"autotest": "mochify --watch --recursive --extension=.jsx --extension=.js" | ||
}, | ||
"devDependencies": { | ||
"babelify": "^6.1.2", | ||
"browserify": "^10.2.4", | ||
"mocha": "^2.2.5", | ||
"mochify": "^2.9.0", | ||
"packageify": "^0.2.2", | ||
"serve": "^1.4.0", | ||
"uglify-js": "^2.4.23", | ||
"watchify": "^3.2.2" | ||
}, | ||
"dependencies": { | ||
"auth0-js": "^6.4.2", | ||
"bonzo": "^2.0.0", | ||
"domready": "^1.0.8", | ||
"flux": "^2.0.3", | ||
"react": "^0.13.3", | ||
"trim": "0.0.1", | ||
"underscore": "^1.8.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
export default class Widget extends React.Component { | ||
render() { | ||
return <h1>Hello world!</h1>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
import Widget from './components/widget'; | ||
|
||
React.render( | ||
<Widget />, | ||
document.getElementById('lock') | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import Widget from '../../src/components/widget'; | ||
import assert from 'assert'; | ||
|
||
describe('Widget', function(){ | ||
|
||
var div; | ||
var comp; | ||
|
||
function render() { | ||
comp = React.render(React.createElement(Widget), div); | ||
} | ||
|
||
beforeEach(function () { | ||
div = document.createElement("div"); | ||
}); | ||
|
||
afterEach(function () { | ||
if (div) { | ||
React.unmountComponentAtNode(div); | ||
comp = null; | ||
} | ||
}); | ||
|
||
it('renders a h1 that says "Hello world!"', function(){ | ||
render(); | ||
|
||
assert(div.querySelector('h1')); | ||
assert.equal(div.querySelector('h1').textContent, 'Hello world!') | ||
}); | ||
}); |