Skip to content

Commit

Permalink
test: add e2e tests for watchFiles option (#4081)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Dec 11, 2021
1 parent ed5406d commit 7abcde1
Show file tree
Hide file tree
Showing 6 changed files with 1,301 additions and 689 deletions.
311 changes: 311 additions & 0 deletions test/e2e/__snapshots__/watch-files.test.js.snap.webpack4
@@ -0,0 +1,311 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should not crash if file doesn't exist should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with array config should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with array config should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with array config should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with object with multiple paths should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with object with single path should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with object with single path should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with object with single path should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": 400,
"persistent": true,
"usePolling": true,
}
`;

exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"interval":400,"poll":200} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": 200,
"persistent": true,
"usePolling": true,
}
`;

exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"poll":200} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": undefined,
"persistent": true,
"usePolling": true,
}
`;

exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"poll":true} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": 200,
"persistent": true,
"usePolling": false,
}
`;

exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":false,"interval":200,"poll":400} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": 200,
"persistent": true,
"usePolling": false,
}
`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":200} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": undefined,
"persistent": true,
"usePolling": false,
}
`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":false,"poll":true} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": undefined,
"persistent": true,
"usePolling": false,
}
`;

exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":false} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": 200,
"persistent": true,
"usePolling": true,
}
`;

exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":true,"interval":200,"poll":400} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": 200,
"persistent": true,
"usePolling": true,
}
`;

exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":true,"poll":200} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed 1`] = `
Object {
"alwaysStat": true,
"atomic": false,
"followSymlinks": false,
"ignoreInitial": true,
"ignorePermissionErrors": true,
"ignored": undefined,
"interval": undefined,
"persistent": true,
"usePolling": true,
}
`;

exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with options {"usePolling":true} should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with string and glob should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with string and glob should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with string and glob should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with string and path to directory should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with string and path to directory should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with string and path to directory should reload when file content is changed: response status 1`] = `200`;

exports[`watchFiles option should work with string and path to file should reload when file content is changed: console messages 1`] = `
Array [
"Hey.",
]
`;

exports[`watchFiles option should work with string and path to file should reload when file content is changed: page errors 1`] = `Array []`;

exports[`watchFiles option should work with string and path to file should reload when file content is changed: response status 1`] = `200`;

0 comments on commit 7abcde1

Please sign in to comment.