Skip to content

Commit

Permalink
test: add more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Nov 15, 2021
1 parent dad303f commit b4a0cfd
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 0 deletions.
56 changes: 56 additions & 0 deletions test/server/__snapshots__/watchFiles-option.test.js.snap.webpack4
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`'watchFiles' option should work with options {"interval":400,"poll":200} should pass correct options to chokidar config 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 {"poll":200} should pass correct options to chokidar config 1`] = `
Object {
"alwaysStat": true,
Expand Down Expand Up @@ -28,6 +42,34 @@ Object {
}
`;

exports[`'watchFiles' option should work with options {"usePolling":false,"interval":200,"poll":400} should pass correct options to chokidar config 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 pass correct options to chokidar config 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":true} should pass correct options to chokidar config 1`] = `
Object {
"alwaysStat": true,
Expand Down Expand Up @@ -70,6 +112,20 @@ Object {
}
`;

exports[`'watchFiles' option should work with options {"usePolling":true,"poll":200} should pass correct options to chokidar config 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} should pass correct options to chokidar config 1`] = `
Object {
"alwaysStat": true,
Expand Down
56 changes: 56 additions & 0 deletions test/server/__snapshots__/watchFiles-option.test.js.snap.webpack5
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`'watchFiles' option should work with options {"interval":400,"poll":200} should pass correct options to chokidar config 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 {"poll":200} should pass correct options to chokidar config 1`] = `
Object {
"alwaysStat": true,
Expand Down Expand Up @@ -28,6 +42,34 @@ Object {
}
`;

exports[`'watchFiles' option should work with options {"usePolling":false,"interval":200,"poll":400} should pass correct options to chokidar config 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 pass correct options to chokidar config 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":true} should pass correct options to chokidar config 1`] = `
Object {
"alwaysStat": true,
Expand Down Expand Up @@ -70,6 +112,20 @@ Object {
}
`;

exports[`'watchFiles' option should work with options {"usePolling":true,"poll":200} should pass correct options to chokidar config 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} should pass correct options to chokidar config 1`] = `
Object {
"alwaysStat": true,
Expand Down
17 changes: 17 additions & 0 deletions test/server/watchFiles-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,18 +327,35 @@ describe("'watchFiles' option", () => {
{
usePolling: true,
},
{
usePolling: true,
poll: 200,
},
{
usePolling: false,
},
{
usePolling: false,
poll: 200,
},
{
usePolling: false,
poll: true,
},
{
interval: 400,
poll: 200,
},
{
usePolling: true,
interval: 200,
poll: 400,
},
{
usePolling: false,
interval: 200,
poll: 400,
},
];

optionCases.forEach((optionCase) => {
Expand Down

0 comments on commit b4a0cfd

Please sign in to comment.