Skip to content

Commit 815f29f

Browse files
committed
update testing
1 parent d72a19d commit 815f29f

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

__tests__/search.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {search} from '../src/index';
2-
import {marktguru} from "../src/@types/marktguru";
1+
import { search } from '../src/index';
2+
import * as marktguru from '../typings/index';
33

44
jest.setTimeout(10000);
55

@@ -18,7 +18,7 @@ const checkOffers = (offers: marktguru.Offer[]) => {
1818
expect(offer.images.urls).toHaveProperty('large');
1919
}
2020
}
21-
}
21+
};
2222

2323
test('search for `Cola`', async () => {
2424
const offers = await search('Cola');
@@ -39,4 +39,4 @@ test('search for `Cola` with options', async () => {
3939
});
4040

4141
checkOffers(offers);
42-
});
42+
});

jest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node'
5+
};

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
"axios": "^0.27.2"
2020
},
2121
"devDependencies": {
22-
"@types/jest": "^28.1.6",
22+
"@types/jest": "^28.1.7",
2323
"jest": "^28.1.3",
2424
"prettier": "^2.7.1",
25+
"ts-jest": "^28.0.8",
2526
"typescript": "^4.7.4"
2627
}
2728
}

0 commit comments

Comments
 (0)