Skip to content

Commit

Permalink
fixing race condition and fixing clear method not working
Browse files Browse the repository at this point in the history
  • Loading branch information
restuwahyu13 committed Jun 5, 2022
1 parent 18e6335 commit 14654ad
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,5 @@ install:
## BUILD AUTOMATION
#########################

build: testc.o compile.o
testc.o:
${NPM} ${NPM_FLAGS} test:coveralls

compile.o:
build:
${NPM} ${NPM_FLAGS} build
26 changes: 10 additions & 16 deletions __test__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,19 @@ describe('Node Disk Storage Group Testing', function () {
expect(await nds.set('age', 23)).toBeTruthy()
})

it('Should be nds get is success', () => {
setTimeout(async () => {
expect(nds.get).toBeDefined()
expect(await nds.get('name')).toEqual('john doe')
}, 500)
it('Should be nds get is success', async (): Promise<void> => {
expect(nds.get).toBeDefined()
expect(await nds.get('name')).toEqual('john doe')
})

it('Should be nds keys is success', () => {
setTimeout(async () => {
expect(nds.keys).toBeDefined()
expect(await nds.keys()).toBeInstanceOf(Array)
expect((await nds.keys()).length).toBe(2)
}, 500)
it('Should be nds keys is success', async (): Promise<void> => {
expect(nds.keys).toBeDefined()
expect(await nds.keys()).toBeInstanceOf(Array)
expect((await nds.keys()).length).toBe(2)
})

it('Should be nds remove is success', () => {
setTimeout(async () => {
expect(nds.remove).toBeDefined()
expect(await nds.remove('name')).toBeTruthy()
}, 500)
it('Should be nds remove is success', async (): Promise<void> => {
expect(nds.remove).toBeDefined()
expect(await nds.remove('name')).toBeTruthy()
})
})
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-disk-storage",
"version": "0.0.4",
"version": "0.0.5",
"description": "fast and secure local storage persistent data for node js",
"main": "./dist/index.js",
"files": [
Expand Down Expand Up @@ -62,7 +62,7 @@
"dependencies": {
"human-size": "^1.1.0",
"is-any-type": "^0.0.4",
"nds-core": "^2.0.1"
"nds-core": "^2.0.2"
},
"devDependencies": {
"@types/jest": "^27.5.2",
Expand Down

0 comments on commit 14654ad

Please sign in to comment.