Skip to content

Commit

Permalink
Add a failing test case for dirty test directories (WordPress#70)
Browse files Browse the repository at this point in the history
See WordPress/playground-tools#32
See
WordPress#503 (comment)

## What?

Adds a failing test case for
WordPress/playground-tools#32 and marks it as
a skipped test.

## Why?

It will make it easier to evaluate whether
WordPress#503 fixes the
issue.

## Testing Instructions

1. Change `test.skip` to `test.only`.
2. Run `nx test wp-now --watch`.
3. Verify the test fails on the second assertion.
4. Comment out the second assertion and hit save.
5. Verify the test fails on the third assertion.
6. Comment out the third assertion and hit save.
7. Verify the test fails on the fourth assertion.
  • Loading branch information
danielbachhuber committed Jun 6, 2023
1 parent 594b714 commit a631fb0
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/wp-now/src/tests/wp-now.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit a631fb0

Please sign in to comment.