Clean up test noise (#1394)

* Fix warning about differing Node binaries

* Fix npm WARNings on test

* Fix chai deprecation notice

* Fix jsdom <script> parse errors

* Fix jsdom Not Implemented errors
This commit is contained in:
Taylor Hunt 2019-08-07 15:34:00 -04:00 committed by Michael Rawlings
parent d013b9b558
commit 0f0fd7b1f7
21 changed files with 21 additions and 16 deletions

1
.npmrc
View File

@ -1 +1,2 @@
registry=https://registry.npmjs.org/
scripts-prepend-node-path=true

View File

@ -29,6 +29,7 @@ module.exports = function(dir, html, options) {
// runScripts: 'dangerously', // JSDOM 10+
beforeParse(window, browser) {
window.global = window;
window.alert = () => {};
jQuery(window);
browser.require("complain").log = (...args) =>
require("complain").log(...args);

View File

@ -1,6 +1,7 @@
{
"name": "marko-test-express-4",
"version": "1.0.0",
"private": true,
"dependencies": {
"express": "^4"
}

View File

@ -1,6 +1,7 @@
{
"name": "marko-test-express-4",
"version": "1.0.0",
"private": true,
"dependencies": {
"express": ">5.0.0-alpha"
}

View File

@ -1,4 +1,5 @@
{
"private": true,
"dependencies": {
"marko": "file:../../"
}

View File

@ -3,7 +3,7 @@
require("../__util__/test-init");
const chai = require("chai");
chai.Assertion.includeStack = true;
chai.config.includeStack = true;
require("chai").should();
const expect = require("chai").expect;

View File

@ -1,4 +1,4 @@
<html><head><title>Inline Script</title></head><body>Hello name! <script type="text/javascript">
<html><head><title>Inline Script</title></head><body>Hello name! <script type="n/a">
<div if(foo)></div>
$(function() {
alert('World');

View File

@ -7,7 +7,7 @@
<body>
Hello ${name}!
<script type="text/javascript">
<script type="n/a">
<div if(foo)></div>
$(function() {
alert('${input.name}');

View File

@ -4,5 +4,5 @@
"Inline Script"
<BODY>
"Hello name! "
<SCRIPT type="text/javascript">
<SCRIPT type="n/a">
"\n <div if(foo)></div>\n $(function() {\n alert('World');\n })\n "

View File

@ -1,3 +1,3 @@
<script>
<script type="text/html">
<DIV>FOO</DIV>
</script>

View File

@ -4,7 +4,7 @@ function compile(bodyText) {
module.exports = function generateCode(elNode, codegen) {
var builder = codegen.builder;
return builder.htmlElement("script", {}, [
return builder.htmlElement("script", { type: '"text/html"' }, [
builder.text(builder.literal(compile(elNode.bodyText)))
]);
};

View File

@ -1,2 +1,2 @@
<SCRIPT>
<SCRIPT type="text/html">
"\n <DIV>FOO</DIV>\n"

View File

@ -1,4 +1,4 @@
<html><head><title>Inline Script</title></head><body>Hello name! <script type="text/javascript">
<html><head><title>Inline Script</title></head><body>Hello name! <script type="n/a">
<div if(foo)></div>
$(function() {
alert('World');

View File

@ -6,7 +6,7 @@ $ var value = "input.name";
</head>
<body>
Hello ${name}!
<script type="text/javascript">
<script type="n/a">
<div if(foo)></div>
$(function() {
alert('${input.name}');

View File

@ -4,5 +4,5 @@
"Inline Script"
<BODY>
"Hello name! "
<SCRIPT type="text/javascript">
<SCRIPT type="n/a">
"\n <div if(foo)></div>\n $(function() {\n alert('World');\n })\n "

View File

@ -1,4 +1,4 @@
<script>
var content = 'abc';
var foo `Text 1: ${content}`;
var foo = `Text 1: ${content}`;
</script>

View File

@ -1,4 +1,4 @@
<script>
var content = 'abc';
var foo `Text 1: ${content}`;
var foo = `Text 1: ${content}`;
</script>

View File

@ -1,2 +1,2 @@
<SCRIPT>
"\nvar content = 'abc';\nvar foo `Text 1: ${content}`;\n"
"\nvar content = 'abc';\nvar foo = `Text 1: ${content}`;\n"

View File

@ -1 +1 @@
<script><test></script>
<script type="n/a"><test></script>

View File

@ -1,6 +1,6 @@
module.exports = function generateCode(elNode, codegen) {
var builder = codegen.builder;
return builder.htmlElement("script", {}, [
return builder.htmlElement("script", { type: '"n/a"' }, [
builder.text(builder.literal("<test>"))
]);
};

View File

@ -1,2 +1,2 @@
<SCRIPT>
<SCRIPT type="n/a">
"<test>"