UNPKG

1.55 kBJavaScriptView Raw
1// Load in our dependencies
2var assert = require('assert');
3
4// Start our tests
5describe('A karma configuration using a __filenameOverride file', function () {
6 // DEV: Determined exepctations via `../reference`
7 it('uses the __filenameOverride for its filename and dirname', function () {
8 // DEV: We use a shortened directory listing to work around line lengths on Appveyor
9 // https://ci.appveyor.com/project/twolfson/karma-electron-launcher/build/180/job/mgc51cvx44uvns7l
10 // Example: /home/todd/github/karma-electron/test/integration-test/test-files/filename-override-context.html
11 assert(/integration-test[\/\\]test-files[\/\\]filename-override-context\.html$/.test(__filename),
12 'Expected "' + __filename + '" to end with "integration-test/test-files/filename-override-context.html"');
13 // Example: /home/todd/github/karma-electron/test/integration-test/test-files
14 assert(/integration-test[\/\\]test-files$/.test(__dirname),
15 'Expected "' + __dirname + '" to end with "integration-test/test-files"');
16 // Example: /home/todd/github/karma-electron/test/integration-test/test-files/filename-override-context.html
17 assert(/integration-test[\/\\]test-files[\/\\]filename-override-context\.html$/.test(module.filename),
18 'Expected "' + module.filename + '" to end with ' +
19 '"integration-test/test-files/filename-override-context.html"');
20 assert.strictEqual(module.id, '.');
21 });
22
23 it('doesn\'t load the file at all', function () {
24 // There is no file on disk so we are fine
25 });
26});