From be8205277dfbbd7ff7a28861ab16bc7c1a89e1cb Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 12 May 2017 08:23:16 -0700 Subject: [PATCH 1/2] Change Node.js unit test require. This allows for compatibility with partial Veneers. --- src/main/resources/com/google/api/codegen/nodejs/test.snip | 2 +- .../google/api/codegen/testdata/nodejs_test_library.baseline | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/com/google/api/codegen/nodejs/test.snip b/src/main/resources/com/google/api/codegen/nodejs/test.snip index 28c5c4e11a..f75bf48da4 100644 --- a/src/main/resources/com/google/api/codegen/nodejs/test.snip +++ b/src/main/resources/com/google/api/codegen/nodejs/test.snip @@ -24,7 +24,7 @@ @private header(apiTest) var assert = require('assert'); @if apiTest.fileHeader.hasVersion - var {@apiTest.apiWrapperModuleName} = require('../src/').{@apiTest.fileHeader.version}(); + var {@apiTest.apiWrapperModuleName} = require('../src/{@apiTest.fileHeader.version}')(); @else var {@apiTest.apiWrapperModuleName} = require('../src/')(); @end diff --git a/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline b/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline index 7253ad5a49..323d10b918 100644 --- a/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline +++ b/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline @@ -16,11 +16,12 @@ */ var assert = require('assert'); -var libraryV1 = require('../src/').v1(); +var libraryV1 = require('../src/v1')(); var through2 = require('through2'); var FAKE_STATUS_CODE = 1; var error = new Error(); + error.code = FAKE_STATUS_CODE; describe('LibraryServiceClient', function() { @@ -1472,4 +1473,3 @@ function mockLongRunningGrpcMethod(expectedRequest, response, error) { return Promise.resolve([mockOperation]); }; } - From aaa9a237fa004a4a9a75a091dd888143974b5a7d Mon Sep 17 00:00:00 2001 From: Ernest Landrito Date: Fri, 12 May 2017 09:51:08 -0700 Subject: [PATCH 2/2] Fix tests --- .../google/api/codegen/testdata/nodejs_test_library.baseline | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline b/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline index 323d10b918..5539c2824b 100644 --- a/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline +++ b/src/test/java/com/google/api/codegen/testdata/nodejs_test_library.baseline @@ -21,7 +21,6 @@ var through2 = require('through2'); var FAKE_STATUS_CODE = 1; var error = new Error(); - error.code = FAKE_STATUS_CODE; describe('LibraryServiceClient', function() { @@ -1473,3 +1472,4 @@ function mockLongRunningGrpcMethod(expectedRequest, response, error) { return Promise.resolve([mockOperation]); }; } +