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:
commit
0ae5305822
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ package
|
||||
builds/
|
||||
notes.txt
|
||||
app/.DS_Store
|
||||
development/bundle.js
|
||||
|
@ -1,3 +1,6 @@
|
||||
machine:
|
||||
node:
|
||||
version: 6.0.0
|
||||
dependencies:
|
||||
pre:
|
||||
- "npm i -g testem"
|
||||
|
10
package.json
10
package.json
@ -5,10 +5,13 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "gulp dev",
|
||||
"test": "mocha --require test/helper.js --compilers js:babel-register --recursive",
|
||||
"watch": "mocha watch --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 \"test/unit/**/*.js\"",
|
||||
"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": {
|
||||
"transform": [
|
||||
@ -96,6 +99,7 @@
|
||||
"mocha-jsdom": "^1.1.0",
|
||||
"mocha-sinon": "^1.1.5",
|
||||
"qs": "^6.2.0",
|
||||
"qunit": "^0.9.1",
|
||||
"sinon": "^1.17.3",
|
||||
"tape": "^4.5.1",
|
||||
"uglifyify": "^3.0.1",
|
||||
|
7
test/integration/helpers.js
Normal file
7
test/integration/helpers.js
Normal file
@ -0,0 +1,7 @@
|
||||
function wait() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
setTimeout(function() {
|
||||
resolve()
|
||||
}, 500)
|
||||
})
|
||||
}
|
22
test/integration/index.html
Normal file
22
test/integration/index.html
Normal 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
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
21
test/integration/tests.js
Normal 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
9
testem.yml
Normal file
@ -0,0 +1,9 @@
|
||||
launch_in_dev:
|
||||
- Chrome
|
||||
- Firefox
|
||||
launch_in_ci:
|
||||
- Chrome
|
||||
- Firefox
|
||||
framework:
|
||||
- qunit
|
||||
test_page: "test/integration/index.html"
|
Loading…
Reference in New Issue
Block a user