mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Enable caching publish directory
This commit is contained in:
parent
a29acbb27b
commit
170f705f0e
4 changed files with 85 additions and 4 deletions
|
|
@ -1,7 +1,11 @@
|
|||
import test from 'ava'
|
||||
|
||||
import { isObject, isString } from '../type-checks.js'
|
||||
import { getNetlifyConfig } from './caching.js'
|
||||
import {
|
||||
getNetlifyConfig,
|
||||
hasCachedPublishFolder,
|
||||
cachePublishFolder
|
||||
} from './caching.js'
|
||||
|
||||
|
||||
test('Can read netlify.toml', async (t) => {
|
||||
|
|
@ -15,8 +19,30 @@ test('Can read netlify.toml', async (t) => {
|
|||
t.is( isString( netlifyConfig.build.publish ) , true )
|
||||
})
|
||||
|
||||
// test('Can cache publish folder', async (t) => {
|
||||
|
||||
test('Can cache publish folder', async (t) => {
|
||||
// So that we don't overwrite the cached files
|
||||
// we check if a cached file already exists
|
||||
|
||||
if ( await hasCachedPublishFolder() ) {
|
||||
t.log('Publish folder has been cached already')
|
||||
t.pass()
|
||||
}
|
||||
|
||||
t.log('No prexisting cache folder found')
|
||||
|
||||
|
||||
// If there's no files there already
|
||||
// then we can write to the directory with
|
||||
await cachePublishFolder()
|
||||
|
||||
|
||||
|
||||
// })
|
||||
if ( (await hasCachedPublishFolder()) === false ) {
|
||||
t.fail()
|
||||
return
|
||||
}
|
||||
|
||||
t.log('Publish folder has been cached already')
|
||||
t.pass()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue