mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(HTTP Request Node): Add additional tests for HTTP response encoding (no-changelog) (#11655)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import nock from 'nock';
|
||||
import {
|
||||
setup,
|
||||
equalityTest,
|
||||
workflowToTests,
|
||||
getWorkflowFilenames,
|
||||
initBinaryDataService,
|
||||
} from '@test/nodes/Helpers';
|
||||
|
||||
describe('Test Quoted Response Encoding', () => {
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
const baseUrl = 'https://dummy.domain';
|
||||
const payload = Buffer.from(
|
||||
'El rápido zorro marrón salta sobre el perro perezoso. ¡Qué bello día en París! Árbol, cañón, façade.',
|
||||
'latin1',
|
||||
);
|
||||
|
||||
beforeAll(async () => {
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.get('/index.html')
|
||||
.reply(200, payload, { 'content-type': 'text/plain; charset="latin1"' });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
test(testData.description, async () => await equalityTest(testData, nodeTypes));
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user