This block of code:

```
            var expectedFileExtensions;

            // Be sure that expectedFileExtensions is not undefined.  
            if (expected.fileExtensions === undefined) {
                expectedFileExtensions = [];
            } else {
                expectedFileExtensions = expected.fileExtensions;
            }
```

Can be replaced by this line of code:

```
            var expectedFileExtensions = expected.fileExtensions || [];
```

When initializing `expectedFileExtensions`, it's set to the first "truthy" element in the OR list. So, if `expected.fileExtensions` is undefined (or null), then it's set to `[]` (an empty array). This code is actually better because it checks for both undefined and null;