diff options
Diffstat (limited to 'sonar-css-plugin/src/test/resources')
| -rw-r--r-- | sonar-css-plugin/src/test/resources/mock-start-server/failedClose.js | 28 | 
1 files changed, 28 insertions, 0 deletions
| diff --git a/sonar-css-plugin/src/test/resources/mock-start-server/failedClose.js b/sonar-css-plugin/src/test/resources/mock-start-server/failedClose.js new file mode 100644 index 0000000..3c0039e --- /dev/null +++ b/sonar-css-plugin/src/test/resources/mock-start-server/failedClose.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +const http = require('http'); +const port = process.argv[2]; + +const requestHandler = (request, response) => { +    let data = []; +    request.on('data', chunk => { +        data.push(chunk); +    }); +    if (request.url === '/status') { +        response.writeHead(200, {'Content-Type': 'text/plain'}); +        response.end('OK!'); +    } else { +        throw "Failure"; +    } +}; + +const server = http.createServer(requestHandler); + +server.listen(port, (err) => { +    if (err) { +        return console.log('something bad happened', err) +    } + +    console.log(`server is listening on ${port}`) +}); + | 
