@aneuhold/core-ts-api-lib 2.1.15 → 2.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) [2024] [Anton G Neuhold Jr]
3
+ Copyright (c) [2025] [Anton G Neuhold Jr]
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@aneuhold/core-ts-api-lib",
3
3
  "author": "Anton G. Neuhold Jr.",
4
4
  "license": "MIT",
5
- "version": "2.1.15",
5
+ "version": "2.1.17",
6
6
  "description": "A library for interacting with the backend and defining the backend API for personal projects.",
7
7
  "packageManager": "pnpm@10.11.1",
8
8
  "type": "module",
@@ -1,38 +0,0 @@
1
- import { BSON } from 'bson';
2
- import { describe, expect, it } from 'vitest';
3
- import { DOFunctionCallOutput } from '../../../services/DOFunctionService/DOFunction.js';
4
- import {
5
- EXAMPLE_FUNCTION_URL,
6
- ExampleFunction,
7
- ExampleInput,
8
- ExampleOutput
9
- } from '../../ExampleFunction.js';
10
- import { TestUtil } from '../../TestUtil.js';
11
-
12
- describe('DOFunction', () => {
13
- it('should call the function and return the expected output', async () => {
14
- const exampleFunction = ExampleFunction.getFunction();
15
-
16
- const input: ExampleInput = { name: 'John' };
17
- const expectedOutput: DOFunctionCallOutput<ExampleOutput> = {
18
- success: true,
19
- errors: [],
20
- data: { greeting: 'Hello, John!' }
21
- };
22
-
23
- TestUtil.mockFetch(expectedOutput);
24
-
25
- const output = await exampleFunction.call(input);
26
-
27
- expect(output).toEqual(expectedOutput);
28
- expect(global.fetch).toHaveBeenCalledWith(EXAMPLE_FUNCTION_URL, {
29
- method: 'POST',
30
- headers: {
31
- Connection: 'keep-alive',
32
- 'Content-Type': 'application/octet-stream',
33
- Accept: 'application/octet-stream'
34
- },
35
- body: Buffer.from(BSON.serialize(input))
36
- });
37
- });
38
- });