11import { test } from 'node:test'
22import assert from 'node:assert'
3- import { DomStack } from '../../index.js'
3+ import { testBuild } from '../../index.js'
44import * as path from 'path'
5- import { rm , stat , readFile } from 'fs/promises'
5+ import { stat , readFile } from 'fs/promises'
66import * as cheerio from 'cheerio'
77import { allFiles } from 'async-folder-walker'
88
@@ -11,12 +11,13 @@ const __dirname = import.meta.dirname
1111test . describe ( 'general-features' , ( ) => {
1212 test ( 'should build site with all features' , async ( t ) => {
1313 const src = path . join ( __dirname , './src' )
14- const dest = path . join ( __dirname , './public' )
15- const siteUp = new DomStack ( src , dest , { copy : [ path . join ( __dirname , './copyfolder' ) ] } )
14+ const build = await testBuild ( src , { copy : [ path . join ( __dirname , './copyfolder' ) ] } )
15+ const { dest, results } = build
1616
17- await rm ( dest , { recursive : true , force : true } )
17+ t . after ( async ( ) => {
18+ await build . cleanup ( )
19+ } )
1820
19- const results = await siteUp . build ( )
2021 assert . ok ( results , 'DomStack built site and returned build results' )
2122
2223 const globalAssets = {
0 commit comments