Skip to content

Commit 05184f8

Browse files
author
Fabrice Bascoulergue
committed
Fix test config
1 parent 5f0c70e commit 05184f8

File tree

5 files changed

+19
-5
lines changed

5 files changed

+19
-5
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Lum Network - Javascript SDK
2+
23
[![npm version](https://badge.fury.io/js/%40lum-network%2Fsdk-javascript.svg)](https://badge.fury.io/js/%40lum-network%2Fsdk-javascript)
34

45
This Javascript SDK enables browsers and NodeJS clients to interact with the Lum Network.

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = {
1010
globals: {
1111
'ts-jest': {
1212
diagnostics: false,
13+
tsconfig: 'tsconfig.spec.json',
1314
},
1415
},
1516
testTimeout: 10000,

src/utils/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ export * from './keys';
55
export * from './transactions';
66
export * from './broadcast';
77
export * from './search';
8-
export * from './logs';
8+
export * from './txlogs';
99
export * from './registry';

src/utils/logs.ts renamed to src/utils/txlogs.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isNonNullObject } from './commons';
22
import { Log, LogEvent, LogAttribute } from '../types';
33

4-
const parseAttribute = (input: unknown): LogAttribute => {
4+
export const parseAttribute = (input: unknown): LogAttribute => {
55
if (!isNonNullObject(input)) throw new Error('Attribute must be a non-null object');
66
const { key, value } = input as { key: unknown; value: unknown };
77
if (typeof key !== 'string' || !key) throw new Error("Attribute's key must be a non-empty string");
@@ -15,7 +15,7 @@ const parseAttribute = (input: unknown): LogAttribute => {
1515
};
1616
};
1717

18-
const parseEvent = (input: unknown): LogEvent => {
18+
export const parseEvent = (input: unknown): LogEvent => {
1919
if (!isNonNullObject(input)) throw new Error('Event must be a non-null object');
2020
const { type, attributes } = input as { type: unknown; attributes: unknown };
2121
if (typeof type !== 'string' || type === '') {
@@ -28,7 +28,7 @@ const parseEvent = (input: unknown): LogEvent => {
2828
};
2929
};
3030

31-
const parseLog = (input: unknown): Log => {
31+
export const parseLog = (input: unknown): Log => {
3232
if (!isNonNullObject(input)) throw new Error('Log must be a non-null object');
3333
const { msg_index, log, events } = input as { msg_index: unknown; log: unknown; events: unknown };
3434
if (typeof msg_index !== 'number') throw new Error("Log's msg_index must be a number");
@@ -41,7 +41,7 @@ const parseLog = (input: unknown): Log => {
4141
};
4242
};
4343

44-
const parseLogs = (input: unknown): readonly Log[] => {
44+
export const parseLogs = (input: unknown): readonly Log[] => {
4545
if (!Array.isArray(input)) throw new Error('Logs must be an array');
4646
return input.map(parseLog);
4747
};

tsconfig.spec.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": ".",
5+
"strict": false,
6+
"strictPropertyInitialization": false,
7+
"sourceMap": false,
8+
"removeComments": true,
9+
"noImplicitAny": false
10+
},
11+
"exclude": ["node_modules"]
12+
}

0 commit comments

Comments
 (0)