aboutsummaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/svg.test.js6
-rw-r--r--web_src/js/test/setup.js (renamed from web_src/js/testUtils/jestSetup.js)2
-rw-r--r--web_src/js/testUtils/jestRawLoader.js5
-rw-r--r--web_src/js/utils.test.js4
4 files changed, 6 insertions, 11 deletions
diff --git a/web_src/js/svg.test.js b/web_src/js/svg.test.js
index f1939c3a46..9f2836b667 100644
--- a/web_src/js/svg.test.js
+++ b/web_src/js/svg.test.js
@@ -1,7 +1,7 @@
import {svg} from './svg.js';
test('svg', () => {
- expect(svg('octicon-repo')).toStartWith('<svg');
- expect(svg('octicon-repo', 16)).toInclude('width="16"');
- expect(svg('octicon-repo', 32)).toInclude('width="32"');
+ expect(svg('octicon-repo')).toMatch(/^<svg/);
+ expect(svg('octicon-repo', 16)).toContain('width="16"');
+ expect(svg('octicon-repo', 32)).toContain('width="32"');
});
diff --git a/web_src/js/testUtils/jestSetup.js b/web_src/js/test/setup.js
index 779be9f0c7..7c208eb0d2 100644
--- a/web_src/js/testUtils/jestSetup.js
+++ b/web_src/js/test/setup.js
@@ -1,5 +1,5 @@
window.config = {
- csrfToken: 'jest-test-csrf-token-123456',
+ csrfToken: 'test-csrf-token-123456',
pageData: {},
i18n: {},
};
diff --git a/web_src/js/testUtils/jestRawLoader.js b/web_src/js/testUtils/jestRawLoader.js
deleted file mode 100644
index 15c9f7dc01..0000000000
--- a/web_src/js/testUtils/jestRawLoader.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default { // eslint-disable-line import/no-unused-modules
- process: (content) => {
- return {code: `module.exports = ${JSON.stringify(content)}`};
- },
-};
diff --git a/web_src/js/utils.test.js b/web_src/js/utils.test.js
index 762f29f6fe..b56d80ac7a 100644
--- a/web_src/js/utils.test.js
+++ b/web_src/js/utils.test.js
@@ -56,8 +56,8 @@ test('joinPaths', () => {
});
test('isObject', () => {
- expect(isObject({})).toBeTrue();
- expect(isObject([])).toBeFalse();
+ expect(isObject({})).toBeTruthy();
+ expect(isObject([])).toBeFalsy();
});
test('uniq', () => {