BREAKING CHANGE(core): major architectural refactoring with cross-platform support and SmartRequest rename
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
||||
|
||||
// For browser tests, we need to import from a browser-safe path
|
||||
// that doesn't trigger Node.js module imports
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
import { tap, expect } from '@git.zone/tstest/tapbundle';
|
||||
|
||||
import { SmartRequestClient } from '../ts/client/index.js';
|
||||
import { SmartRequest } from '../ts/client/index.js';
|
||||
|
||||
tap.test('client: should request a html document over https', async () => {
|
||||
const response = await SmartRequestClient.create()
|
||||
const response = await SmartRequest.create()
|
||||
.url('https://encrypted.google.com/')
|
||||
.get();
|
||||
|
||||
@@ -15,7 +15,7 @@ tap.test('client: should request a html document over https', async () => {
|
||||
});
|
||||
|
||||
tap.test('client: should request a JSON document over https', async () => {
|
||||
const response = await SmartRequestClient.create()
|
||||
const response = await SmartRequest.create()
|
||||
.url('https://jsonplaceholder.typicode.com/posts/1')
|
||||
.get();
|
||||
|
||||
@@ -26,7 +26,7 @@ tap.test('client: should request a JSON document over https', async () => {
|
||||
|
||||
tap.test('client: should post a JSON document over http', async () => {
|
||||
const testData = { text: 'example_text' };
|
||||
const response = await SmartRequestClient.create()
|
||||
const response = await SmartRequest.create()
|
||||
.url('https://httpbin.org/post')
|
||||
.json(testData)
|
||||
.post();
|
||||
@@ -41,7 +41,7 @@ tap.test('client: should set headers correctly', async () => {
|
||||
const customHeader = 'X-Custom-Header';
|
||||
const headerValue = 'test-value';
|
||||
|
||||
const response = await SmartRequestClient.create()
|
||||
const response = await SmartRequest.create()
|
||||
.url('https://httpbin.org/headers')
|
||||
.header(customHeader, headerValue)
|
||||
.get();
|
||||
@@ -57,7 +57,7 @@ tap.test('client: should set headers correctly', async () => {
|
||||
tap.test('client: should handle query parameters', async () => {
|
||||
const params = { param1: 'value1', param2: 'value2' };
|
||||
|
||||
const response = await SmartRequestClient.create()
|
||||
const response = await SmartRequest.create()
|
||||
.url('https://httpbin.org/get')
|
||||
.query(params)
|
||||
.get();
|
||||
@@ -72,7 +72,7 @@ tap.test('client: should handle query parameters', async () => {
|
||||
|
||||
tap.test('client: should handle timeout configuration', async () => {
|
||||
// This test just verifies that the timeout method doesn't throw
|
||||
const client = SmartRequestClient.create()
|
||||
const client = SmartRequest.create()
|
||||
.url('https://httpbin.org/get')
|
||||
.timeout(5000);
|
||||
|
||||
@@ -83,7 +83,7 @@ tap.test('client: should handle timeout configuration', async () => {
|
||||
|
||||
tap.test('client: should handle retry configuration', async () => {
|
||||
// This test just verifies that the retry method doesn't throw
|
||||
const client = SmartRequestClient.create()
|
||||
const client = SmartRequest.create()
|
||||
.url('https://httpbin.org/get')
|
||||
.retry(1);
|
||||
|
||||
|
Reference in New Issue
Block a user