Skip to content

Commit 14654ad

Browse files
committed
fixing race condition and fixing clear method not working
1 parent 18e6335 commit 14654ad

File tree

4 files changed

+22
-32
lines changed

4 files changed

+22
-32
lines changed

Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,5 @@ install:
5050
## BUILD AUTOMATION
5151
#########################
5252

53-
build: testc.o compile.o
54-
testc.o:
55-
${NPM} ${NPM_FLAGS} test:coveralls
56-
57-
compile.o:
53+
build:
5854
${NPM} ${NPM_FLAGS} build

__test__/index.test.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,19 @@ describe('Node Disk Storage Group Testing', function () {
1717
expect(await nds.set('age', 23)).toBeTruthy()
1818
})
1919

20-
it('Should be nds get is success', () => {
21-
setTimeout(async () => {
22-
expect(nds.get).toBeDefined()
23-
expect(await nds.get('name')).toEqual('john doe')
24-
}, 500)
20+
it('Should be nds get is success', async (): Promise<void> => {
21+
expect(nds.get).toBeDefined()
22+
expect(await nds.get('name')).toEqual('john doe')
2523
})
2624

27-
it('Should be nds keys is success', () => {
28-
setTimeout(async () => {
29-
expect(nds.keys).toBeDefined()
30-
expect(await nds.keys()).toBeInstanceOf(Array)
31-
expect((await nds.keys()).length).toBe(2)
32-
}, 500)
25+
it('Should be nds keys is success', async (): Promise<void> => {
26+
expect(nds.keys).toBeDefined()
27+
expect(await nds.keys()).toBeInstanceOf(Array)
28+
expect((await nds.keys()).length).toBe(2)
3329
})
3430

35-
it('Should be nds remove is success', () => {
36-
setTimeout(async () => {
37-
expect(nds.remove).toBeDefined()
38-
expect(await nds.remove('name')).toBeTruthy()
39-
}, 500)
31+
it('Should be nds remove is success', async (): Promise<void> => {
32+
expect(nds.remove).toBeDefined()
33+
expect(await nds.remove('name')).toBeTruthy()
4034
})
4135
})

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-disk-storage",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "fast and secure local storage persistent data for node js",
55
"main": "./dist/index.js",
66
"files": [
@@ -62,7 +62,7 @@
6262
"dependencies": {
6363
"human-size": "^1.1.0",
6464
"is-any-type": "^0.0.4",
65-
"nds-core": "^2.0.1"
65+
"nds-core": "^2.0.2"
6666
},
6767
"devDependencies": {
6868
"@types/jest": "^27.5.2",

0 commit comments

Comments
 (0)