Skip to content

Commit

Permalink
Update tests to use wct-mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
keanulee committed Dec 4, 2018
1 parent d557e7b commit df54d39
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 312 deletions.
459 changes: 184 additions & 275 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@
"@webcomponents/webcomponentsjs": "^2.0.0"
},
"devDependencies": {
"@polymer/test-fixture": "^4.0.2",
"chai": "^4.1.2",
"del": "^3.0.0",
"gulp": "^4.0.0",
"gulp-rename": "^1.3.0",
"gulp-replace": "^1.0.0",
"mocha": "^5.2.0",
"polymer-cli": "^1.7.0",
"prpl-server": "^1.1.0",
"wct-browser-legacy": "^1.0.0"
"sinon": "^7.1.1",
"wct-mocha": "^1.0.0"
}
}
3 changes: 2 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>Tests</title>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>
<script>
Expand Down
16 changes: 9 additions & 7 deletions test/shop-cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>shop-cart</title>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>

<!-- Import the element to test -->
<script type="module" src="../src/shop-cart.js"></script>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>

Expand All @@ -29,7 +27,11 @@
</template>
</test-fixture>

<script>
<script type="module">
import '@polymer/test-fixture';
import sinon from 'sinon';
import '../src/shop-cart.js';

suite('shop-cart tests', function() {
var cart;

Expand Down
15 changes: 8 additions & 7 deletions test/shop-checkout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>shop-checkout</title>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>

<!-- Import the element to test -->
<script type="module" src="../src/shop-checkout.js"></script>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>

Expand All @@ -29,7 +27,10 @@
</template>
</test-fixture>

<script>
<script type="module">
import '@polymer/test-fixture';
import '../src/shop-checkout.js';

suite('shop-checkout tests', function() {
var checkout;

Expand Down
16 changes: 9 additions & 7 deletions test/shop-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>shop-detail</title>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>

<!-- Import the element to test -->
<script type="module" src="../src/shop-detail.js"></script>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>

Expand All @@ -29,7 +27,11 @@
</template>
</test-fixture>

<script>
<script type="module">
import '@polymer/test-fixture';
import sinon from 'sinon';
import '../src/shop-detail.js';

suite('shop-detail tests', function() {
var detail;

Expand Down
16 changes: 9 additions & 7 deletions test/shop-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>shop-home</title>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>

<!-- Import the element to test -->
<script type="module" src="../src/shop-home.js"></script>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>

Expand All @@ -29,7 +27,11 @@
</template>
</test-fixture>

<script>
<script type="module">
import '@polymer/test-fixture';
import sinon from 'sinon';
import '../src/shop-home.js';

suite('shop-home tests', function() {
var home;

Expand Down
16 changes: 9 additions & 7 deletions test/shop-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>shop-list</title>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-bundle.js"></script>
<script src="../node_modules/wct-browser-legacy/browser.js"></script>

<!-- Import the element to test -->
<script type="module" src="../src/shop-list.js"></script>

<script src="../node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script src="../node_modules/chai/chai.js"></script>
<script src="../node_modules/mocha/mocha.js"></script>
<script src="../node_modules/wct-mocha/wct-mocha.js"></script>
</head>
<body>

Expand All @@ -29,7 +27,11 @@
</template>
</test-fixture>

<script>
<script type="module">
import '@polymer/test-fixture';
import sinon from 'sinon';
import '../src/shop-list.js';

suite('shop-list tests', function() {
var list;

Expand Down

0 comments on commit df54d39

Please sign in to comment.