Permalink
Browse files

fix mobile script upload test on Windows

  • Loading branch information...
1 parent 6536f25 commit 131bcb2dcc69d6f62021aaa59f199e93eac3556e @tjanczuk tjanczuk committed Dec 7, 2012
Showing with 4 additions and 1 deletion.
  1. +2 −0 test/commands/cli.mobile-tests.js
  2. +2 −1 test/commands/cli.mobile-tests.nock.js
@@ -167,6 +167,8 @@ suite('azure mobile', function(){
// do not filter on body of app create request, since it contains random GUIDs that would mismatch
line = line.replace(/(\.post\('\/[^\/]*\/applications')[^\)]+\)/, '.filteringRequestBody(function (path) { return \'*\';})\n$1, \'*\')');
+ // do not filter on the body of script upload, since line endings differ between Windows and Mac
+ line = line.replace(/(\.put\('[^\']*')\, \"[^\"]+\"\)/, '.filteringRequestBody(function (path) { return \'*\';})\n$1, \'*\')');
// nock encoding bug
line = line.replace("'error'", "\\'error\\'");
// nock is loosing the port number
@@ -655,7 +655,8 @@ nock('https://management.core.windows.net')
return result; }],
[function (nock) { var result =
nock('https://management.core.windows.net')
- .put('/342d6bc9-21b7-427d-a31c-04956f221bd1/services/mobileservices/mobileservices/clitest6aa9b366-9cc6-43b8-a739-4bf388c51ce1/tables/table1/scripts/insert/code', "function insert(item, user, request) {\n console.log('Sample information');\n console.error('Sample error');\n request.execute();\n}")
+ .filteringRequestBody(function (path) { return '*';})
+ .put('/342d6bc9-21b7-427d-a31c-04956f221bd1/services/mobileservices/mobileservices/clitest6aa9b366-9cc6-43b8-a739-4bf388c51ce1/tables/table1/scripts/insert/code', '*')
.reply(200, "", { 'cache-control': 'no-cache',
pragma: 'no-cache',
'transfer-encoding': 'chunked',

0 comments on commit 131bcb2

Please sign in to comment.