-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add unit tests and fix params for test
- Loading branch information
1 parent
679c001
commit 29b7665
Showing
11 changed files
with
154 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
initializeFieldsAsUndefined=false,forceLong=long | ||
forceLong=long |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { OptionalsTest } from "./simple"; | ||
|
||
describe("proto2-optionals", () => { | ||
it("it compiles", () => { | ||
require("./simple"); | ||
}); | ||
|
||
it("creates a message and correctly doesn't set optional fields", () => { | ||
const message = OptionalsTest.create(); | ||
|
||
const encoded = OptionalsTest.encode(message).finish(); | ||
const decoded = OptionalsTest.decode(encoded); | ||
|
||
expect(decoded).toEqual(message); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
initializeFieldsAsUndefined=false,disableProto2DefaultValues=true | ||
disableProto2DefaultValues=true |
16 changes: 16 additions & 0 deletions
16
integration/proto2-no-default-vals/proto2-optionals-test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { OptionalsTest } from "./simple"; | ||
|
||
describe("proto2-optionals", () => { | ||
it("it compiles", () => { | ||
require("./simple"); | ||
}); | ||
|
||
it("creates a message and correctly doesn't set optional fields", () => { | ||
const message = OptionalsTest.create(); | ||
|
||
const encoded = OptionalsTest.encode(message).finish(); | ||
const decoded = OptionalsTest.decode(encoded); | ||
|
||
expect(decoded).toEqual(message); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
initializeFieldsAsUndefined=false,disableProto2Optionals=true | ||
disableProto2Optionals=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { OptionalsTest } from "./simple"; | ||
|
||
describe("proto2-optionals", () => { | ||
it("it compiles", () => { | ||
require("./simple"); | ||
}); | ||
|
||
it("creates a message and correctly doesn't set optional fields", () => { | ||
const message = OptionalsTest.create(); | ||
|
||
const encoded = OptionalsTest.encode(message).finish(); | ||
const decoded = OptionalsTest.decode(encoded); | ||
|
||
expect(decoded).toEqual(message); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
initializeFieldsAsUndefined=false | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { OptionalsTest } from "./simple"; | ||
|
||
describe("proto2-optionals", () => { | ||
it("it compiles", () => { | ||
require("./simple"); | ||
}); | ||
|
||
it("creates a message and correctly doesn't set optional fields", () => { | ||
const message = OptionalsTest.create(); | ||
|
||
const encoded = OptionalsTest.encode(message).finish(); | ||
const decoded = OptionalsTest.decode(encoded); | ||
|
||
expect(decoded).toEqual(message); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters