Skip to content

Commit 1310606

Browse files
authored
Add unit test for crlf (#137)
1 parent 5de5275 commit 1310606

File tree

4 files changed

+79
-3
lines changed

4 files changed

+79
-3
lines changed

.gitattributes

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* text=auto
22

3-
*.sh text eol=lf
3+
*.sh text eol=lf
4+
**test_config_file_crlf.json text eol=crlf # for testing

airbyte-local-cli-nodejs/test/__snapshots__/utils.it.test.ts.snap

+35-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ exports[`generateConfig should succeed with static configs 1`] = `
6767
"
6868
`;
6969

70-
exports[`parseConfigFile should parse utf16 encoding 1`] = `
70+
exports[`parseConfigFile should parse crlf 1`] = `
7171
{
7272
"dst": {
7373
"catalog": {},
@@ -108,6 +108,40 @@ exports[`parseConfigFile should parse utf16 encoding 1`] = `
108108
}
109109
`;
110110

111+
exports[`parseConfigFile should parse utf16 encoding 1`] = `
112+
{
113+
"dst": {
114+
"catalog": {},
115+
"config": {
116+
"edition_config": {
117+
"api_key": "***",
118+
"api_url": "https://prod.api.faros.ai",
119+
"edition": "cloud",
120+
"graph": "default",
121+
},
122+
},
123+
"dockerOptions": {
124+
"maxCpus": 2,
125+
"maxMemory": 2048,
126+
},
127+
"image": "farosai/airbyte-servicenow-destination",
128+
},
129+
"src": {
130+
"catalog": {},
131+
"config": {
132+
"password": "***",
133+
"url": "https://test-instance.service-now.com",
134+
"username": "test-username",
135+
},
136+
"dockerOptions": {
137+
"maxCpus": 2,
138+
"maxMemory": 2048,
139+
},
140+
"image": "farosai/airbyte-servicenow-source",
141+
},
142+
}
143+
`;
144+
111145
exports[`parseConfigFile should pass 1`] = `
112146
{
113147
"dst": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"src": {
3+
"image": "farosai/airbyte-servicenow-source",
4+
"config": {
5+
"username": "test-username",
6+
"password": "***",
7+
"url": "https://test-instance.service-now.com"
8+
},
9+
"catalog": {},
10+
"dockerOptions": {
11+
"maxMemory": 2048,
12+
"maxCpus": 2,
13+
"additionalOptions": {
14+
"HostConfig": {
15+
"Binds": [
16+
"/test/path:/test/path/test.json"
17+
]
18+
}
19+
}
20+
}
21+
},
22+
"dst": {
23+
"image": "farosai/airbyte-servicenow-destination",
24+
"config": {
25+
"edition_config": {
26+
"graph": "default",
27+
"edition": "cloud",
28+
"api_url": "https://prod.api.faros.ai",
29+
"api_key": "***"
30+
}
31+
},
32+
"catalog": {},
33+
"dockerOptions": {
34+
"maxMemory": 2048,
35+
"maxCpus": 2
36+
}
37+
}
38+
}

airbyte-local-cli-nodejs/test/utils.it.test.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ describe('parseConfigFile', () => {
7777
expect(() => parseConfigFile('test_config_file_invalid')).toThrow();
7878
});
7979
it('should parse utf16 encoding', () => {
80-
expect(parseConfigFile('test/resources/test_config_file.json')).toMatchSnapshot();
80+
expect(parseConfigFile('test/resources/test_config_file_utf16.json')).toMatchSnapshot();
81+
});
82+
it('should parse crlf', () => {
83+
expect(parseConfigFile('test/resources/test_config_file_crlf.json')).toMatchSnapshot();
8184
});
8285
});
8386

0 commit comments

Comments
 (0)