-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: acceptance test the public api
- Loading branch information
1 parent
41e423a
commit 3a0f63e
Showing
7 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
export default { | ||
files: ['!test/**/*'], | ||
files: [ | ||
'!test/**/*', | ||
'src/**/*.test.js', | ||
'exports/**/*.test.js', | ||
'test/acceptance/**/*.test.js', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import FileEngine from '../../src/engines/FileEngine.js'; | ||
import FileEngine from '../../src/engine/FileEngine.js'; | ||
|
||
export default FileEngine; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Persist from '@acodeninja/persist'; | ||
import test from 'ava'; | ||
|
||
test('Persist contains the String Type', t => { | ||
t.is(Persist.Type.String.name, 'StringType'); | ||
}); | ||
|
||
test('Persist contains the Number Type', t => { | ||
t.is(Persist.Type.Number.name, 'NumberType'); | ||
}); | ||
|
||
test('Persist contains the Boolean Type', t => { | ||
t.is(Persist.Type.Boolean.name, 'BooleanType'); | ||
}); | ||
|
||
test('Persist contains the Resolved Slug Type', t => { | ||
t.is(Persist.Type.Resolved.Slug.name, 'SlugType'); | ||
}); | ||
|
||
test('Persist contains the Complex Custom Type', t => { | ||
t.is(Persist.Type.Custom.name, 'CustomType'); | ||
}); | ||
|
||
test('Persist contains the Model Type', t => { | ||
t.is(Persist.Type.Model.name, 'Model'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import FileEngine from '@acodeninja/persist/engine/file'; | ||
import Persist from '@acodeninja/persist'; | ||
import fs from 'node:fs/promises'; | ||
import test from 'ava'; | ||
|
||
test('Persist allows adding the FileEngine', t => { | ||
Persist.addEngine('files', FileEngine, { | ||
path: '/tmp/fileEngine', | ||
}); | ||
|
||
t.like(Persist._engine.files.FileEngine._configuration, { | ||
path: '/tmp/fileEngine', | ||
filesystem: fs, | ||
}); | ||
}); | ||
|
||
test('Persist allows retrieving a FileEngine', t => { | ||
Persist.addEngine('files', FileEngine, { | ||
path: '/tmp/fileEngine', | ||
}); | ||
|
||
t.like(Persist.getEngine('files', FileEngine)._configuration, { | ||
path: '/tmp/fileEngine', | ||
filesystem: fs, | ||
}); | ||
}); |