This file contains hidden or 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
exports.describe = async (name, callback) => { | |
const output = []; | |
const test = async (name, callback) => { | |
const testStartTime = Date.now(); | |
const testResult = await callback(); | |
const testTime = | |
Date.now() - testStartTime; | |
output.push( | |
`• ${name} (${testTime}ms): ${ | |
testResult ? '✅' : '❌' |
This file contains hidden or 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
module.exports = storeName => { | |
const files = FileManager.iCloud(); | |
const documents = files.documentsDirectory(); | |
const stores = `${documents}/stores`; | |
const store = `${stores}/${storeName}`; | |
if (!files.isDirectory(stores)) { | |
files.createDirectory(stores); | |
} |
This file contains hidden or 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
const createStore = importModule('store'); | |
const { describe } = importModule('test'); | |
const store = createStore('store-test'); | |
await describe('Store', async test => { | |
const key = 'key'; | |
const value = 'value'; | |
await test('Saves and retrieves a value', async () => { | |
store.set(key, value); |
OlderNewer