mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
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:
parent
d013b9b558
commit
0f0fd7b1f7
@ -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);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "marko-test-express-4",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"express": "^4"
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "marko-test-express-4",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"express": ">5.0.0-alpha"
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"marko": "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;
|
||||
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<body>
|
||||
Hello ${name}!
|
||||
|
||||
<script type="text/javascript">
|
||||
<script type="n/a">
|
||||
<div if(foo)></div>
|
||||
$(function() {
|
||||
alert('${input.name}');
|
||||
|
||||
@ -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 "
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<script>
|
||||
<script type="text/html">
|
||||
<DIV>FOO</DIV>
|
||||
</script>
|
||||
@ -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)))
|
||||
]);
|
||||
};
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
<SCRIPT>
|
||||
<SCRIPT type="text/html">
|
||||
"\n <DIV>FOO</DIV>\n"
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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}');
|
||||
|
||||
@ -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 "
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<script>
|
||||
var content = 'abc';
|
||||
var foo `Text 1: ${content}`;
|
||||
var foo = `Text 1: ${content}`;
|
||||
</script>
|
||||
@ -1,4 +1,4 @@
|
||||
<script>
|
||||
var content = 'abc';
|
||||
var foo `Text 1: ${content}`;
|
||||
var foo = `Text 1: ${content}`;
|
||||
</script>
|
||||
@ -1,2 +1,2 @@
|
||||
<SCRIPT>
|
||||
"\nvar content = 'abc';\nvar foo `Text 1: ${content}`;\n"
|
||||
"\nvar content = 'abc';\nvar foo = `Text 1: ${content}`;\n"
|
||||
|
||||
@ -1 +1 @@
|
||||
<script><test></script>
|
||||
<script type="n/a"><test></script>
|
||||
@ -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>"))
|
||||
]);
|
||||
};
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
<SCRIPT>
|
||||
<SCRIPT type="n/a">
|
||||
"<test>"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user