fix test-suite by disabling color matching

This commit is contained in:
Nik Graf 2017-08-14 18:21:59 +02:00
parent 7da35d6181
commit 2bcd836b2f
No known key found for this signature in database
GPG Key ID: 7A97512F916175F1
3 changed files with 5 additions and 5 deletions

View File

@ -143,7 +143,7 @@ describe('Emit', () => {
).to.equal(true);
expect(logStub.getCall(0).args[0]).to.equal(
// eslint-disable-next-line max-len
'\u001b[38;5;178m Serverless \u001b[39mEmitted the event userCreated as datatype application/json:\n \u001b[38;5;243m{\u001b[39m\n\u001b[38;5;243m "key": "value"\u001b[39m\n\u001b[38;5;243m }\u001b[39m'
' Serverless Emitted the event userCreated as datatype application/json:\n {\n "key": "value"\n }'
);
});
});
@ -163,7 +163,7 @@ describe('Emit', () => {
).to.equal(true);
expect(logStub.getCall(0).args[0]).to.equal(
// eslint-disable-next-line max-len
'\u001b[38;5;178m Serverless \u001b[39mEmitted the event userCreated as datatype text/plain:\n \u001b[38;5;243m"This is a message"\u001b[39m'
' Serverless Emitted the event userCreated as datatype text/plain:\n "This is a message"'
);
});
});

View File

@ -29,7 +29,7 @@ describe('logEventGateway', () => {
})
);
expect(logStub.calledOnce).to.be.equal(true);
const expected = '\u001b[38;5;173m Event Gateway \u001b[39mFunction registered: s1-f1\n';
const expected = ' Event Gateway Function registered: s1-f1\n';
expect(logStub.getCall(0).args[0]).to.be.equal(expected);
});
@ -47,7 +47,7 @@ describe('logEventGateway', () => {
);
expect(logStub.calledOnce).to.be.equal(true);
const expected = // eslint-disable-next-line max-len
'\u001b[38;5;173m Event Gateway \u001b[39mEvent received: undefined\n\u001b[38;5;243m {\u001b[39m\n\u001b[38;5;243m "headers": {\u001b[39m\n\u001b[38;5;243m "Accept": [\u001b[39m\n\u001b[38;5;243m "image/webp,image/apng,image/*,*/*;q=0.8"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "Accept-Encoding": [\u001b[39m\n\u001b[38;5;243m "gzip, deflate, br"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "Accept-Language": [\u001b[39m\n\u001b[38;5;243m "en-US,en;q=0.8"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "Cache-Control": [\u001b[39m\n\u001b[38;5;243m "no-cache"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "Connection": [\u001b[39m\n\u001b[38;5;243m "keep-alive"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "Pragma": [\u001b[39m\n\u001b[38;5;243m "no-cache"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "Referer": [\u001b[39m\n\u001b[38;5;243m "http://localhost:4000/"\u001b[39m\n\u001b[38;5;243m ],\u001b[39m\n\u001b[38;5;243m "User-Agent": [\u001b[39m\n\u001b[38;5;243m "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"\u001b[39m\n\u001b[38;5;243m ]\u001b[39m\n\u001b[38;5;243m },\u001b[39m\n\u001b[38;5;243m "query": {},\u001b[39m\n\u001b[38;5;243m "body": ""\u001b[39m\n\u001b[38;5;243m }\u001b[39m\n';
' Event Gateway Event received: undefined\n {\n "headers": {\n "Accept": [\n "image/webp,image/apng,image/*,*/*;q=0.8"\n ],\n "Accept-Encoding": [\n "gzip, deflate, br"\n ],\n "Accept-Language": [\n "en-US,en;q=0.8"\n ],\n "Cache-Control": [\n "no-cache"\n ],\n "Connection": [\n "keep-alive"\n ],\n "Pragma": [\n "no-cache"\n ],\n "Referer": [\n "http://localhost:4000/"\n ],\n "User-Agent": [\n "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36"\n ]\n },\n "query": {},\n "body": ""\n }\n';
expect(logStub.getCall(0).args[0]).to.be.equal(expected);
});
});

View File

@ -51,7 +51,7 @@
"sls": "./bin/serverless"
},
"scripts": {
"test": "env FORCE_COLOR=1 istanbul cover -x '**/*.test.js' node_modules/mocha/bin/_mocha '!(node_modules)/**/*.test.js' -- --require=sinon-bluebird -R spec --recursive",
"test": "env FORCE_COLOR=0 istanbul cover -x '**/*.test.js' node_modules/mocha/bin/_mocha '!(node_modules)/**/*.test.js' -- --require=sinon-bluebird -R spec --recursive",
"lint": "eslint . --cache",
"docs": "node scripts/generate-readme.js",
"simple-integration-test": "jest --maxWorkers=5 simple-suite",