1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Merge branch 'master' into usd-conversion

This commit is contained in:
Kevin Serrano 2016-07-26 10:07:02 +09:00
commit 0ae5305822
8 changed files with 74 additions and 3 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ package
builds/ builds/
notes.txt notes.txt
app/.DS_Store app/.DS_Store
development/bundle.js

View File

@ -1,3 +1,6 @@
machine: machine:
node: node:
version: 6.0.0 version: 6.0.0
dependencies:
pre:
- "npm i -g testem"

View File

@ -5,10 +5,13 @@
"private": true, "private": true,
"scripts": { "scripts": {
"start": "gulp dev", "start": "gulp dev",
"test": "mocha --require test/helper.js --compilers js:babel-register --recursive", "test": "mocha --require test/helper.js --compilers js:babel-register --recursive \"test/unit/**/*.js\" && npm run ci",
"watch": "mocha watch --compilers js:babel-register --recursive", "watch": "mocha watch --compilers js:babel-register --recursive \"test/unit/**/*.js\"",
"ui": "node development/genStates.js && beefy ui-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./", "ui": "node development/genStates.js && beefy ui-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./",
"mock": "beefy mock-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./" "mock": "beefy mock-dev.js:bundle.js --live --open --index=./development/index.html --cwd ./",
"buildMock": "browserify ./mock-dev.js -o ./development/bundle.js",
"testem": "npm run buildMock && testem",
"ci": "npm run buildMock && testem ci -P 2"
}, },
"browserify": { "browserify": {
"transform": [ "transform": [
@ -96,6 +99,7 @@
"mocha-jsdom": "^1.1.0", "mocha-jsdom": "^1.1.0",
"mocha-sinon": "^1.1.5", "mocha-sinon": "^1.1.5",
"qs": "^6.2.0", "qs": "^6.2.0",
"qunit": "^0.9.1",
"sinon": "^1.17.3", "sinon": "^1.17.3",
"tape": "^4.5.1", "tape": "^4.5.1",
"uglifyify": "^3.0.1", "uglifyify": "^3.0.1",

View File

@ -0,0 +1,7 @@
function wait() {
return new Promise(function(resolve, reject) {
setTimeout(function() {
resolve()
}, 500)
})
}

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>QUnit Example</title>
<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-2.0.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="https://code.jquery.com/qunit/qunit-2.0.0.js"></script>
<script src="./jquery-3.1.0.min.js"></script>
<script src="helpers.js"></script>
<script src="tests.js"></script>
<script src="/testem.js"></script>
<iframe src="/development/index.html" height="500px" width="360px">
<p>Your browser does not support iframes</p>
</iframe>
</body>
</html>

4
test/integration/jquery-3.1.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

21
test/integration/tests.js Normal file
View File

@ -0,0 +1,21 @@
QUnit.test('agree to terms', function (assert) {
var done = assert.async()
// Select the mock app root
var app = $('iframe').contents().find('#app-content .mock-app-root')
// Agree to terms
app.find('button').click()
// Wait for view to transition:
wait().then(function() {
var title = app.find('h1').text()
assert.equal(title, 'MetaMask', 'title screen')
var buttons = app.find('button')
assert.equal(buttons.length, 2, 'two buttons: create and restore')
done()
})
})

9
testem.yml Normal file
View File

@ -0,0 +1,9 @@
launch_in_dev:
- Chrome
- Firefox
launch_in_ci:
- Chrome
- Firefox
framework:
- qunit
test_page: "test/integration/index.html"