Skip to content
This repository was archived by the owner on Apr 7, 2018. It is now read-only.
This repository was archived by the owner on Apr 7, 2018. It is now read-only.

front-end code in the file being tested may cause graphViz code to be displayed unparsed #56

@juniorbird

Description

@juniorbird

Example:

'use strict';
const minty = require('minty');
const http = require('http');


const testDoc = `
<html>
  <head>
    <title>Minty Node Example</title>
    <script type="text/javascript">
    var alertContent = 'If this alert shows, you have done a  great job!';

    function showAlert(string) {
      alert(string);
    }
    </script>
  </head>
  <body onload="showAlert(alertContent);">
    <h1>Minty Node Example</h1>
    <p>
      <a onclick="showAlert(alertContent)">Click to show alert again</a>!
    </p>
  </body>
</html>
`;

const testHeader = { 'Content-Type': 'text/plain' }

function sendContent(response, content, header) {
  response.writeHead(200, header);
  response.end(content);
}

var sendMinty = minty.wrap(sendContent);

http.createServer((req, res) => {
  sendMinty(res, testDoc, testHeader);
}).listen(3000);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions