Commit 4e3868d5 authored by Tomáš Hübelbauer's avatar Tomáš Hübelbauer

Stub test files for suggested tests

parent 299065ca
......@@ -2,33 +2,13 @@
> Planned development:
## Add a test for the skipping unchanged files
## Finish `skip-unchanged.mjs` test
- Run normal test
- Remember the file change date of the text file
- Run test again
- Verify the date has not changed
## Finish `verify-generated-warnings.mjs` test
## Add a test for generated warnings
## Finish `dispose-abandoned.mjs` test
- Run a normal test
- Verify `README.md` exists and matches expected text
- Verify text file first line is the warning text
- Verify corresponding XML file has the XML comment
## Add a test for disposing of abandoned extraction directories
- Run a normal test
- Delete the Office file
- Run the script again
- Confirm directory doesn't exist anymore
## Add a test for the Git hook code
- Create the Office file
- Set up the Git hook by copying over `hook/pre-commit.sh`
- Run Git commit
- Verify extraction directory has been created and text file matches
## Finish `verify-pre-commit-hook.mjs` test
## Utilize GitHub/GitLab CI on top of the pre-commit hook
......
import { generateTemporaryOfficeFile, initializeGitRepository, stageGitFile, invokePowerShellScript } from '../util.mjs';
export default async function() {
const { directoryPath, filePath } = await generateTemporaryOfficeFile('docx', word => {
const paragraph = word.createP();
paragraph.addText('Hello, World!');
});
await initializeGitRepository(directoryPath);
await stageGitFile(filePath, directoryPath);
await invokePowerShellScript(directoryPath);
// TODO: Remove the `office.docx` file
await invokePowerShellScript(directoryPath);
// TODO: Confirm `office.docx.git` directory is removed
}
import { generateTemporaryOfficeFile, initializeGitRepository, stageGitFile, invokePowerShellScript } from '../util.mjs';
export default async function() {
const { directoryPath, filePath } = await generateTemporaryOfficeFile('docx', word => {
const paragraph = word.createP();
paragraph.addText('Hello, World!');
});
await initializeGitRepository(directoryPath);
await stageGitFile(filePath, directoryPath);
await invokePowerShellScript(directoryPath);
// TODO: Remember date of `word/document.xml.txt`
await invokePowerShellScript(directoryPath);
// TODO: Compare date of `word/document.xml.txt`
}
import { generateTemporaryOfficeFile, initializeGitRepository, stageGitFile, invokePowerShellScript } from '../util.mjs';
export default async function() {
const { directoryPath, filePath } = await generateTemporaryOfficeFile('docx', word => {
const paragraph = word.createP();
paragraph.addText('Hello, World!');
});
await initializeGitRepository(directoryPath);
await stageGitFile(filePath, directoryPath);
await invokePowerShellScript(directoryPath);
// TODO: Check `README.md` for content match
// TODO: Check `word/document.xml.txt` for first line match
// TODO: Check `word/document.xml` for XML comment match
}
import { generateTemporaryOfficeFile, initializeGitRepository, stageGitFile, invokePowerShellScript } from '../util.mjs';
export default async function() {
const { directoryPath, filePath } = await generateTemporaryOfficeFile('docx', word => {
const paragraph = word.createP();
paragraph.addText('Hello, World!');
});
await initializeGitRepository(directoryPath);
await stageGitFile(filePath, directoryPath);
// TODO: Copy over `hook/pre-commit-development.sh`
// TODO: Run Git commit
// TODO: Verify `office.docx.git` directory exists
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment