-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit tests: Restore site-data.spec.ts
The test was removed in #1192 due to intermittent failures like these: ``` FAIL src/lib/steps/site-data.spec.ts > Blueprint step setSiteOptions() > should set the site option ``` They seem related to #1189, but all the other tests pass and the Playground website works so I wonder what's going on there. Is the CI runner just running out of memory? But then it shouldn't be able to allocate the memory segment in the first place. Weird!
- Loading branch information
Showing
3 changed files
with
43 additions
and
0 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
37 changes: 37 additions & 0 deletions
37
packages/playground/blueprints/src/lib/steps/site-data.spec.ts
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,37 @@ | ||
import { NodePHP } from '@php-wasm/node'; | ||
import { | ||
RecommendedPHPVersion, | ||
getWordPressModule, | ||
} from '@wp-playground/wordpress'; | ||
import { setSiteOptions } from './site-data'; | ||
import { unzip } from './unzip'; | ||
|
||
describe('Blueprint step setSiteOptions()', () => { | ||
let php: NodePHP; | ||
beforeEach(async () => { | ||
php = await NodePHP.load(RecommendedPHPVersion, { | ||
requestHandler: { | ||
documentRoot: '/wordpress', | ||
}, | ||
}); | ||
await unzip(php, { | ||
zipFile: await getWordPressModule(), | ||
extractToPath: '/wordpress', | ||
}); | ||
}); | ||
|
||
it('should set the site option', async () => { | ||
await setSiteOptions(php, { | ||
options: { | ||
blogname: 'My test site!', | ||
}, | ||
}); | ||
const response = await php.run({ | ||
code: `<?php | ||
require '/wordpress/wp-load.php'; | ||
echo get_option('blogname'); | ||
`, | ||
}); | ||
expect(response.text).toBe('My test site!'); | ||
}); | ||
}); |
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