Skip to content

Commit

Permalink
Merge pull request #6 from Designory/chore/use-babel-mocha-tests
Browse files Browse the repository at this point in the history
Chore - Runs mocha through @babel/register
  • Loading branch information
romellem authored Aug 22, 2020
2 parents e4bcf9a + 5f58b91 commit 4f0b7e1
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 38 deletions.
1 change: 1 addition & 0 deletions .mocharc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require: '@babel/register'
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
"delegate": "^3.2.0"
},
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/core": "^7.11.4",
"@babel/preset-env": "^7.11.0",
"@rollup/plugin-babel": "^5.1.0",
"@babel/register": "^7.10.5",
"@rollup/plugin-babel": "^5.2.0",
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.4.0",
"global-jsdom": "^6.1.0",
Expand Down
9 changes: 2 additions & 7 deletions test/templates.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
const basic = () => `<div id="modal">Hello</div>`;
const basicWithClose = (close_btn = `<button data-modal-close="">x</button>`) =>
export const basic = () => `<div id="modal">Hello</div>`;
export const basicWithClose = (close_btn = `<button data-modal-close="">x</button>`) =>
`<div id="modal">Hello${close_btn}</div>`;

module.exports = {
basic,
basicWithClose,
};
8 changes: 4 additions & 4 deletions test/tests.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const yamodal = require('../dist/umd/yamodal');
const assert = require('assert');
const jsdom = require('global-jsdom');
import yamodal from '../dist/umd/yamodal';
import assert from 'assert';
import jsdom from 'global-jsdom';

const templates = require('./templates.js');
import * as templates from './templates.js';
const DOCTYPE = `<!doctype html>`;
const HTML = (str = '') => `<html><head><meta charset="utf-8"></head><body>${str}</body></html>`;

Expand Down
99 changes: 74 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
invariant "^2.2.4"
semver "^5.5.0"

"@babel/core@^7.11.1":
version "7.11.1"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.1.tgz#2c55b604e73a40dc21b0e52650b11c65cf276643"
integrity sha512-XqF7F6FWQdKGGWAzGELL+aCO1p+lRY5Tj5/tbT3St1G8NaH70jhhDIKknIZaDans0OQBG5wRAldROLHSt44BgQ==
"@babel/core@^7.11.4":
version "7.11.4"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.11.4.tgz#4301dfdfafa01eeb97f1896c5501a3f0655d4229"
integrity sha512-5deljj5HlqRXN+5oJTY7Zs37iH3z3b++KjiKtIsJy1NrjOOVSEaJHEetLBhyu0aQOSNNZ/0IuEAan9GzRuDXHg==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/generator" "^7.11.0"
"@babel/generator" "^7.11.4"
"@babel/helper-module-transforms" "^7.11.0"
"@babel/helpers" "^7.10.4"
"@babel/parser" "^7.11.1"
"@babel/parser" "^7.11.4"
"@babel/template" "^7.10.4"
"@babel/traverse" "^7.11.0"
"@babel/types" "^7.11.0"
Expand Down Expand Up @@ -88,6 +88,15 @@
jsesc "^2.5.1"
source-map "^0.5.0"

"@babel/generator@^7.11.4":
version "7.11.4"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.11.4.tgz#1ec7eec00defba5d6f83e50e3ee72ae2fee482be"
integrity sha512-Rn26vueFx0eOoz7iifCN2UHT6rGtnkSGWSoDRIy8jZN3B91PzeSULbswfLoOWuTuAcNwpG/mxy+uCTDnZ9Mp1g==
dependencies:
"@babel/types" "^7.11.0"
jsesc "^2.5.1"
source-map "^0.5.0"

"@babel/helper-annotate-as-pure@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz#5bf0d495a3f757ac3bda48b5bf3b3ba309c72ba3"
Expand Down Expand Up @@ -235,13 +244,6 @@
dependencies:
"@babel/types" "^7.10.4"

"@babel/helper-module-imports@^7.7.4":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz#7fe39589b39c016331b6b8c3f441e8f0b1419498"
integrity sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==
dependencies:
"@babel/types" "^7.8.3"

"@babel/helper-module-transforms@^7.10.1":
version "7.10.1"
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz#24e2f08ee6832c60b157bb0936c86bef7210c622"
Expand Down Expand Up @@ -445,10 +447,10 @@
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.0.tgz#a9d7e11aead25d3b422d17b2c6502c8dddef6a5d"
integrity sha512-qvRvi4oI8xii8NllyEc4MDJjuZiNaRzyb7Y7lup1NqJV8TZHF4O27CcP+72WPn/k1zkgJ6WJfnIbk4jTsVAZHw==

"@babel/parser@^7.11.1":
version "7.11.2"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.2.tgz#0882ab8a455df3065ea2dcb4c753b2460a24bead"
integrity sha512-Vuj/+7vLo6l1Vi7uuO+1ngCDNeVmNbTngcJFKCR/oEtz8tKz0CJxZEGmPt9KcIloZhOZ3Zit6xbpXT2MDlS9Vw==
"@babel/parser@^7.11.4":
version "7.11.4"
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.11.4.tgz#6fa1a118b8b0d80d0267b719213dc947e88cc0ca"
integrity sha512-MggwidiH+E9j5Sh8pbrX5sJvMcsqS5o+7iB42M9/k0CD63MjYbdP4nhSh7uB5wnv2/RVzTZFTxzF/kIa5mrCqA==

"@babel/plugin-proposal-async-generator-functions@^7.10.4":
version "7.10.5"
Expand Down Expand Up @@ -993,6 +995,17 @@
"@babel/types" "^7.4.4"
esutils "^2.0.2"

"@babel/register@^7.10.5":
version "7.10.5"
resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.10.5.tgz#354f3574895f1307f79efe37a51525e52fd38d89"
integrity sha512-eYHdLv43nyvmPn9bfNfrcC4+iYNwdQ8Pxk1MFJuU/U5LpSYl/PH4dFMazCYZDFVi8ueG3shvO+AQfLrxpYulQw==
dependencies:
find-cache-dir "^2.0.0"
lodash "^4.17.19"
make-dir "^2.1.0"
pirates "^4.0.0"
source-map-support "^0.5.16"

"@babel/runtime@^7.10.3":
version "7.11.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.11.0.tgz#f10245877042a815e07f7e693faff0ae9d3a2aac"
Expand Down Expand Up @@ -1152,13 +1165,13 @@
node-gyp "^6.1.0"
read-package-json-fast "^1.1.3"

"@rollup/plugin-babel@^5.1.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.1.0.tgz#ad8b5803fa6e1feb0f168984edc040b90d966450"
integrity sha512-zXBEYmfiLAMvB+ZBa6m/q9hsQYAq1sUFdjuP1F6C2pf6uQcpHwAWQveZgzS63zXdKPUYHD3Dr7BhjCqcr0bbLw==
"@rollup/plugin-babel@^5.2.0":
version "5.2.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.2.0.tgz#b87556d61ed108b4eaf9d18b5323965adf8d9bee"
integrity sha512-CPABsajaKjINgBQ3it+yMnfVO3ibsrMBxRzbUOUw2cL1hsZJ7aogU8mgglQm3S2hHJgjnAmxPz0Rq7DVdmHsTw==
dependencies:
"@babel/helper-module-imports" "^7.7.4"
"@rollup/pluginutils" "^3.0.8"
"@babel/helper-module-imports" "^7.10.4"
"@rollup/pluginutils" "^3.1.0"

"@rollup/plugin-commonjs@^14.0.0":
version "14.0.0"
Expand Down Expand Up @@ -2091,6 +2104,15 @@ fill-range@^7.0.1:
dependencies:
to-regex-range "^5.0.1"

find-cache-dir@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-2.1.0.tgz#8d0f94cd13fe43c6c7c261a0d86115ca918c05f7"
integrity sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==
dependencies:
commondir "^1.0.1"
make-dir "^2.0.0"
pkg-dir "^3.0.0"

find-cache-dir@^3.2.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880"
Expand Down Expand Up @@ -2897,6 +2919,14 @@ magic-string@^0.25.2:
dependencies:
sourcemap-codec "^1.4.4"

make-dir@^2.0.0, make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==
dependencies:
pify "^4.0.1"
semver "^5.6.0"

make-dir@^3.0.0, make-dir@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
Expand Down Expand Up @@ -3101,6 +3131,11 @@ node-gyp@^6.1.0:
tar "^4.4.12"
which "^1.3.1"

node-modules-regexp@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40"
integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=

node-preload@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301"
Expand Down Expand Up @@ -3461,6 +3496,20 @@ pify@^4.0.1:
resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==

pirates@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"
integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==
dependencies:
node-modules-regexp "^1.0.0"

pkg-dir@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3"
integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==
dependencies:
find-up "^3.0.0"

pkg-dir@^4.1.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3"
Expand Down Expand Up @@ -3800,7 +3849,7 @@ semver@7.0.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e"
integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==

semver@^5.4.1, semver@^5.5.0, semver@^5.7.1:
semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
Expand Down Expand Up @@ -3873,7 +3922,7 @@ socks@^2.3.3:
ip "1.1.5"
smart-buffer "^4.1.0"

source-map-support@~0.5.12:
source-map-support@^0.5.16, source-map-support@~0.5.12:
version "0.5.19"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
Expand Down

0 comments on commit 4f0b7e1

Please sign in to comment.