diff --git a/packages/wp-now/src/tests/wp-now.spec.ts b/packages/wp-now/src/tests/wp-now.spec.ts index 9e46955747..8f2dedc2fd 100644 --- a/packages/wp-now/src/tests/wp-now.spec.ts +++ b/packages/wp-now/src/tests/wp-now.spec.ts @@ -514,6 +514,43 @@ describe('Test starting different modes', () => { expect(themeName.text).toContain('Twenty Twenty-Three'); }); + /** + * Test that startWPNow doesn't leave dirty files. + * + * @see https://github.com/WordPress/playground-tools/issues/32 + */ + test.skip('startWPNow does not leave dirty folders and files', async () => { + const projectPath = path.join(tmpExampleDirectory, 'wordpress'); + const options = await getWpNowConfig({ path: projectPath }); + await startWPNow(options); + expect( + fs.existsSync( + path.join( + projectPath, + 'wp-content', + 'mu-plugins', + '0-allow-wp-org.php' + ) + ) + ).toBe(false); + expect( + fs.existsSync(path.join(projectPath, 'wp-content', 'database')) + ).toBe(false); + expect( + fs.existsSync( + path.join( + projectPath, + 'wp-content', + 'plugins', + 'sqlite-database-integration' + ) + ) + ).toBe(false); + expect( + fs.existsSync(path.join(projectPath, 'wp-content', 'db.php')) + ).toBe(false); + }); + /** * Test PHP integration test executing runCli. */