{"id":1515,"date":"2023-04-01T03:00:00","date_gmt":"2023-04-01T01:00:00","guid":{"rendered":"https:\/\/demo.sidekick.be\/itenium\/javascript-testing-jasmine-to-jest\/"},"modified":"2025-11-28T13:31:43","modified_gmt":"2025-11-28T12:31:43","slug":"javascript-testing-jasmine-to-jest","status":"publish","type":"post","link":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/","title":{"rendered":"JavaScript Testing: Jasmine to Jest"},"content":{"rendered":"<p> Jest does seem to have more \u2b50\u2b50\u2b50<\/p>\n<p><a href=\"https:\/\/github.com\/jasmine\/jasmine\" class=\"github\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/github\/stars\/jasmine\/jasmine.svg?style=social&amp;label=Star\" \/><\/a><a href=\"https:\/\/github.com\/jasmine\/jasmine\">jasmine\/jasmine<\/a>: Simple JavaScript testing framework for browsers and node.js <a href=\"https:\/\/github.com\/facebook\/jest\" class=\"github\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/github\/stars\/facebook\/jest.svg?style=social&amp;label=Star\" \/><\/a><a href=\"https:\/\/github.com\/facebook\/jest\">facebook\/jest<\/a>: Delightful JavaScript Testing.<\/p>\n<h1 id=\"automatic-migration\">Automatic Migration<\/h1>\n<p><a href=\"https:\/\/github.com\/skovhus\/jest-codemods\" class=\"github\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/github\/stars\/skovhus\/jest-codemods.svg?style=social&amp;label=Star\" \/><\/a><a href=\"https:\/\/github.com\/skovhus\/jest-codemods\">skovhus\/jest-codemods<\/a>: Codemods for migrating to Jest<\/p>\n<p>Instead of going through the entire Jest documentation to find out what the differences are between Jasmine and Jest, I just used <code>jest-codemods<\/code> followed by a <code>git diff<\/code>.<\/p>\n<p><!-- I had some trouble getting `jest-codemods` to actually do something, so in the end I just selected \"_All of the above (use with care)!_\" in its interactive CLI and that worked just great \ud83d\ude03 --><\/p>\n<p>I can be so efficient sometimes.<\/p>\n<pre><code class=\"language-sh\">npx jest-codemods --help\nnpx jest-codemods .\n<\/code><\/pre>\n<h1 id=\"configuration\">Configuration<\/h1>\n<p>Create a <code>jest.config.ts<\/code>:<\/p>\n<pre><code class=\"language-sh\">npx jest --init\n<\/code><\/pre>\n<p>In Jasmine there was <code>spec\/helpers<\/code>, now the entry point for global configuration is in <code>jest.config.ts<\/code>.<\/p>\n<pre><code class=\"language-json\">\/\/ A list of paths to modules that run some code to configure\n\/\/ or set up the testing framework before each test\nsetupFilesAfterEnv: [\".\/setupJest.js\"],\n<\/code><\/pre>\n<p>Example <code>setupJest.js<\/code>:<\/p>\n<pre><code class=\"language-js\">\/\/ Set a global variable\nglobal.__DEV__ = true;\n\n\/\/ Or a global function\nglobal.t = t =&gt; t;\n\n\/\/ Custom equality tester\n\/\/ Return undefined if you want to give other testers a chance\nconst reInventToBe = (a, b) =&gt; a === b;\nexpect.addEqualityTesters([reInventToBe]);\n\n\/\/ Custom matchers\nexpect.extend({ yourMatcher });\n<\/code><\/pre>\n<h2 id=\"custom-matchers\">Custom Matchers<\/h2>\n<p>Use <code>expect.extend<\/code> instead of <code>jasmine.addMatchers<\/code>.<\/p>\n<p>The return type of a custom matcher is slightly different in Jest: The <code>message<\/code> type changes from <code>string<\/code> to <code>() =&gt; string<\/code>.<\/p>\n<pre><code class=\"language-js\">expect.extend({\n  yourMatcher(actual, expected, y, z) {\n    return {\n      pass: true,\n      message: () =&gt; {\n        const prettyActual = this.utils.printReceived(actual);\n        const prettyExpected = this.utils.printExpected(expected);\n        return `${prettyActual} is not something by ${prettyExpected}`;\n      },\n    };\n  },\n});\n\n\/\/ Usage\nexpect(100).yourMatcher(99, 'param-y', 'param-z');\n<\/code><\/pre>\n<h1 id=\"the-differences\">The Differences<\/h1>\n<ul>\n<li>In Jest <code>test<\/code> is an alias for <code>it<\/code>.<\/li>\n<li><code>jasmine.xxx<\/code> matchers typically translate directly to <code>expect.xxx<\/code>.\n<ul>\n<li>Ex: <code>jasmine.arrayContaining<\/code> \u2013&gt; <code>expect.arrayContaining<\/code>.<\/li>\n<li>Jasmine has some (pretty useless) without equivalent in Jest.<\/li>\n<li>But Jest has bunches more than Jasmine\u2026<\/li>\n<\/ul>\n<\/li>\n<li>Jest has <a href=\"https:\/\/jestjs.io\/docs\/api#each\">test.each<\/a> to run an array of inputs<\/li>\n<\/ul>\n<h2 id=\"spies\">Spies<\/h2>\n<p>There are some differences in syntax when using spies, most is solved automatically by the code-mod. Jest offers a cleaner API with additional functionality.<\/p>\n<p class=\"notice--danger\">But a <strong>big<\/strong> difference here is that while Jasmine does not execute the original implementation, Jest <strong>DOES<\/strong>.<\/p>\n<pre><code class=\"language-js\">\/\/ Setting up the Spy\nconst mataHari = {\n  setBar(value, times) {return value * times;}\n};\n\n\/\/ The same behavior in Jasmine: spyOn(x, y).and.callThrough()\nconst spie = jest.spyOn(mataHari, 'setBar');\n\n\n\/\/ If you want to mimick Jasmine behavior of NOT calling the original impl:\n\/\/ In this case it doesn't matter much because there are no side effects\n\/\/ If you are mocking an API call, you may want the Jasmine behavior instead!\n\/\/ jest.spyOn(mataHari, 'setBar').mockImplementation(() =&gt; 0);\n\n\n\/\/ Making calls\nmataHari.setBar(1);\nmataHari.setBar(2, 10);\n\n\/\/ Inspecting calls\nexpect(mataHari.setBar.mock.calls[0][0]).toBe(1);\nexpect(mataHari.setBar.mock.calls[1][0]).toBe(2);\nexpect(mataHari.setBar.mock.calls[1][1]).toBe(10);\nexpect(mataHari.setBar.mock.lastCall[1]).toBe(10);\n\n\/\/ Inspecting call returns\nexpect(mataHari.setBar.mock.results).toHaveLength(2);\nexpect(mataHari.setBar.mock.results[1].type).toBe('return'); \/\/ or 'throw'\nexpect(mataHari.setBar.mock.results[1].value).toBe(20); \/\/ == 2 * 10\n\n\/\/ Clearing calls, results, ...\nexpect(mataHari.setBar.mock.calls).toHaveLength(2);\nspie.mockClear();\nexpect(mataHari.setBar.mock.calls).toHaveLength(0);\n\n\/\/ Also remove any mockReturnValue etc\nspie.mockReset();\n\n\/\/ In an afterEach or something\njest.restoreAllMocks();\n<\/code><\/pre>\n<h2 id=\"proxyquire--mocks\">proxyquire \u2013&gt; Mocks<\/h2>\n<p>Replace the <code>api.js<\/code> dependency in <code>cut.js<\/code>:<\/p>\n<pre><code class=\"language-js\">const apiStub = {};\n\n\/\/ proxyquire\nconst proxyquire = require('proxyquire');\nconst cut = proxyquire('.\/cut.js', {'.\/api.js': apiStub});\n\n\/\/ Jest\njest.mock('.\/api.js', () =&gt; apiStub);\nconst cut = require('.\/cut.js');\n<\/code><\/pre>\n<p>So the <code>proxyquire<\/code> package is not needed in Jest. Jest mocks are also much more versatile\u2026<\/p>\n<h2 id=\"async\">Async<\/h2>\n<p>Jasmine has <code>done.fail(err)<\/code>. This has been simplified to just <code>done(err)<\/code> in Jest.<\/p>\n<pre><code class=\"language-js\">const pie = Promise.resolve(3.14);\n\n\/\/ Jasmine\nawait expectAsync(pie).toBeResolvedTo(3.14);\n\n\/\/ Jest\nreturn expect(pie).resolves.toBe(3.14);\n\n\/\/ Jest: Setting up mock Promises\nconst p1 = jest.fn().mockResolvedValue(1);\nconst p2 = jest.fn().mockRejectedValue(err);\n\/\/ is shorthand for\nconst p1 = jest.fn().mockImplementation(() =&gt; Promise.resolve(1));\n<\/code><\/pre>\n<p> <!-- Useless info: ## Not in Jest - arrayWithExactContents - toBePositiveInfinity and toBeNegativeInfinity: Who cares I guess - toHaveSpyInteractions --><\/p>\n<h1 id=\"tldr---differences-table\">TL;DR &#8211; Differences Table<\/h1>\n<p>The tl;dr version:<\/p>\n<table class=\"table-code\">\n<thead>\n<tr>\n<th>Jasmine<\/th>\n<th>Jest<\/th>\n<th>Remarks<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Matchers<\/strong><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>toMatch(\u2018\\sbar\u2019)<\/td>\n<td>toMatch(\/sbar\/)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>toContain(partialObj)<\/td>\n<td>toContainEqual(partialObj)<\/td>\n<td>Or toMatchObject()<\/td>\n<\/tr>\n<tr>\n<td>withContext<\/td>\n<td>Extra describe()<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>toThrowMatching<\/td>\n<td>toThrowError(\/regex\/)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><strong>Spies<\/strong><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>jasmine.createSpy(\u2018n\u2019)<\/td>\n<td>jest.fn()<\/td>\n<td>+ mockName(\u2018n\u2019) and getMockName()<\/td>\n<\/tr>\n<tr>\n<td>jasmine.createSpyObj(\u2018n\u2019, [\u2018f1\u2019, \u2018f2\u2019])<\/td>\n<td>({ f1: jest.fn(), f2: jest.fn() })<\/td>\n<td>With f1, f2 being the functions<\/td>\n<\/tr>\n<tr>\n<td>jasmine.createSpyObj(\u2018n\u2019, {f: 1})<\/td>\n<td>({ f: jest.fn(() =&gt; 1)})<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><strong>spyOn<\/strong><\/td>\n<td>jest.spyOn<\/td>\n<td>spyOn is a global in Jasmine<\/td>\n<\/tr>\n<tr>\n<td>spyOnProperty(obj, \u2018prop\u2019, \u2018get\u2019)<\/td>\n<td>jest.spyOn(obj, \u2018prop\u2019, \u2018get\u2019)<\/td>\n<td>With \u2018prop\u2019 the property name and the third parameter \u2018get\u2019 or \u2018set\u2019<\/td>\n<\/tr>\n<tr>\n<td>.calls<\/td>\n<td>.mock.calls<\/td>\n<td>Ex: obj.prop.mock.calls<\/td>\n<\/tr>\n<tr>\n<td>.calls.any() \/ .count()<\/td>\n<td>.mock.calls.length<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>.calls.mostRecent<\/td>\n<td>.mock.lastCall<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>.calls.reset()<\/td>\n<td>.mockClear()<\/td>\n<td>In Jest this is on the mock object itself, not on .calls<\/td>\n<\/tr>\n<tr>\n<td>.and.callFake(fn)<\/td>\n<td>.mockImplementation(fn)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>.and.returnValue(1)<\/td>\n<td>.mockReturnValue(2)<\/td>\n<td>Ex: jest.spyOn(obj, \u2018prop\u2019).mockReturnValue(2);<\/td>\n<\/tr>\n<tr>\n<td>.and.returnValues(1, 2)<\/td>\n<td>.mockReturnValueOnce(1) .mockReturnValueOnce(2)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>.and.throwError(err)<\/td>\n<td>.mockImplementation(() =&gt; {throw err})<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><strong>Async<\/strong><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>expectAsync<\/td>\n<td>resolves\/rejects<\/td>\n<td>Ex: expect(promise).resolves.toBe(true)<\/td>\n<\/tr>\n<tr>\n<td>toBeResolvedTo<\/td>\n<td>.resolves.toBe<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>toBeRejectedWith<\/td>\n<td>.rejects.toMatch<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><strong>Time Travel<\/strong><\/td>\n<td><\/td>\n<td>Manipulate new Date()<\/td>\n<\/tr>\n<tr>\n<td>jasmine.clock().install()<\/td>\n<td>jest.useFakeTimers()<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>jasmine.clock().tick(1)<\/td>\n<td>jest.advanceTimersByTime(1)<\/td>\n<td>Also: advanceTimersByTimeAsync<\/td>\n<\/tr>\n<tr>\n<td>jasmine.clock().mockDate(d)<\/td>\n<td>jest.setSystemTime(d)<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>jasmine.clock().uninstall()<\/td>\n<td>jest.useRealTimers()<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>???<\/td>\n<td>jest.runAllTimersAsync()<\/td>\n<td>Also: runOnlyPendingTimers, advanceTimersToNextTimer, \u2026<\/td>\n<\/tr>\n<tr>\n<td><strong>Other<\/strong><\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>jasmine.addMatchers<\/td>\n<td>expect.extend<\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td>addCustomEqualityTester(t)<\/td>\n<td>addEqualityTesters([t])<\/td>\n<td>Jasmine: 1 tester, Jest: Array of tester(s)!<\/td>\n<\/tr>\n<tr>\n<td>proxyquire<\/td>\n<td>jest.mock<\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1 id=\"vscode-integration\">VSCode Integration<\/h1>\n<p>Jest works out of the box when using <a href=\"https:\/\/create-react-app.dev\/docs\/debugging-tests\"><code>create-react-app<\/code><\/a>! (link contains the VSCode <code>launch.json<\/code>) after installing the Jest VSCode Extension:<\/p>\n<p><a href=\"https:\/\/github.com\/jest-community\/vscode-jest\" class=\"github\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/github\/stars\/jest-community\/vscode-jest.svg?style=social&amp;label=Star\" \/><\/a><a href=\"https:\/\/github.com\/jest-community\/vscode-jest\">jest-community\/vscode-jest<\/a>: The optimal flow for Jest based testing in VS Code<\/p>\n<p><strong>How it looks<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/itenium-be.github.io\/blog-posts-new\/assets\/blog-images\/vscode-jest-test-runner.png\" alt=\"Visual UnitTest result cues in Visual Studio Code\" title=\"Pretty slick\" \/><\/p>\n<h2 id=\"notifications\">Notifications?<\/h2>\n<p>Set <code>notify: true<\/code> in <code>jest.config.ts<\/code>.<\/p>\n<pre><code class=\"language-sh\">npm install -S node-notifier\n<\/code><\/pre>\n<p>And get that dopamine shot every time it says 0 tests failed \ud83d\ude03<\/p>\n<h1 id=\"conclusions\">Conclusions<\/h1>\n<p>Key points:<\/p>\n<ul>\n<li>If you have an existing code base, use <code>jest-codemods<\/code>.<\/li>\n<li>The matcher syntax is almost 100% identical.<\/li>\n<li>Timers syntax <code>jasmine.clock<\/code> vs <code>jest.useFakeTimers<\/code>\n<ul>\n<li>It\u2019s a completely different API<\/li>\n<li>But it\u2019s converted 100% by the code-mod<\/li>\n<li>Jest offers more control over timers<\/li>\n<\/ul>\n<\/li>\n<li>Spies: A slightly different API, also code-modded for you!<\/li>\n<li>proxyquire is built in with <code>jest.mock<\/code><\/li>\n<\/ul>\n<p>Next up, the real reason to switch to Jest: React Component testing.<\/p>\n<p>Well aside of, you know, the very nice VSCode integration which works out of the box with <code>create-react-app<\/code>.<\/p>\n<p>Also note that today is truly the perfect day to publish a \u201cJest\u201d article!<\/p>\n<h1>Also in this series<\/h1>\n<ul>\n<li>Part 1: <a href=\"\/javascript\/javascript-testing-jasmine-getting-started\/\">JavaScript Testing: Getting started with Jasmine<\/a><\/li>\n<li>Part 2: <a href=\"\/javascript\/javascript-testing-jasmine-syntax\/\">JavaScript Testing: Jasmine syntax<\/a><\/li>\n<li>Part 3: <a href=\"\/javascript\/javascript-testing-jasmine-spies\/\">JavaScript Testing: Jasmine Spies<\/a><\/li>\n<li>Part 4: <a href=\"\/javascript\/javascript-testing-jasmine-async\/\">JavaScript Testing: Jasmine async syntax<\/a><\/li>\n<li>Part 5: <a href=\"\/javascript\/javascript-testing-jasmine-customization\/\">JavaScript Testing: Jasmine customization<\/a><\/li>\n<li>Part 6: <a href=\"\/javascript\/javascript-testing-jasmine-plugins\/\">JavaScript Testing: Jasmine plugins<\/a><\/li>\n<li>This Part: JavaScript Testing: Jasmine to Jest<\/li>\n<\/ul>\n<h1>Extras<\/h1>\n<p><b>Stuff that came into being during the making of this post<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/itenium-be\/jasmine-tut\">Example UnitTests for Jasmine, TypeScript, Jest and Ava<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/itenium-be\/Frontend-UnitTesting\">The technical session materials (pptx etc)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/itenium-be\/confac\">Jest exercises with increasing complexity in a real-world project (TS, React, Express, Mongo). Use git checkout jest-start<\/a><\/li>\n<\/ul>\n<p><b>Other interesting reads<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/jestjs.io\/docs\/getting-started\">Official Jest Documentation<\/a><\/li>\n<\/ul>\n<h1> Package Versions <i class=\"fa fa-info-circle\" style=\"float: right; color: cornflowerblue; font-size: 28px\" title=\"Package versions used for this post and in the accompanying code on Github\"><\/i><\/h1>\n<div><a href=\"https:\/\/github.com\/facebook\/jest\" class=\"github\"><img decoding=\"async\" src=\"https:\/\/img.shields.io\/github\/stars\/facebook\/jest.svg?style=social&#038;label=Star\" \/><\/a><a href=\"https:\/\/github.com\/facebook\/jest\">facebook\/jest<\/a>: v29.5.0 <\/div>\n","protected":false},"excerpt":{"rendered":"<h1 class=\"hide-from-excerpt\" id=\"jasmine-vs-jest\">Jasmine vs Jest<\/h1>\n<p>When you search \u201c<strong>Jasmine vs Jest<\/strong>\u201d, you get a lot of high level comparisons which might be helpful when you have yet to write your first test. This is no such article, this is the article that answers the question<\/p>\n<p class=\"notice--info\"><em>What are the actual <strong>syntax and API differences<\/strong> between Jasmine and Jest?<\/em><\/p>\n<p>Head to the bottom of the article for the <strong>tl;dr difference table<\/strong> or for the <strong>slick VSCode integration<\/strong>.<\/p>\n","protected":false},"author":1,"featured_media":2043,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[3],"tags":[21,6],"class_list":["post-1515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-testing","tag-tutorial"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JavaScript Testing: Jasmine to Jest - Itenium<\/title>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Testing: Jasmine to Jest - Itenium\" \/>\n<meta property=\"og:description\" content=\"Jasmine vs JestWhen you search \u201cJasmine vs Jest\u201d, you get a lot of high level comparisons which might be helpful when you have yet to write your first test. This is no such article, this is the article that answers the questionWhat are the actual syntax and API differences between Jasmine and Jest?Head to the bottom of the article for the tl;dr difference table or for the slick VSCode integration.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/\" \/>\n<meta property=\"og:site_name\" content=\"Itenium\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-01T01:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-28T12:31:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png\" \/>\n\t<meta property=\"og:image:width\" content=\"360\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Usdevelop\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Usdevelop\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/\",\"url\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/\",\"name\":\"JavaScript Testing: Jasmine to Jest - Itenium\",\"isPartOf\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png\",\"datePublished\":\"2023-04-01T01:00:00+00:00\",\"dateModified\":\"2025-11-28T12:31:43+00:00\",\"author\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022\"},\"breadcrumb\":{\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#primaryimage\",\"url\":\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png\",\"contentUrl\":\"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png\",\"width\":360,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/demo.sidekick.be\/itenium\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript Testing: Jasmine to Jest\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#website\",\"url\":\"https:\/\/demo.sidekick.be\/itenium\/\",\"name\":\"Itenium\",\"description\":\"We build software. We build careers.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/demo.sidekick.be\/itenium\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022\",\"name\":\"Usdevelop\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g\",\"caption\":\"Usdevelop\"},\"sameAs\":[\"https:\/\/demo.sidekick.be\/itenium\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Testing: Jasmine to Jest - Itenium","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"JavaScript Testing: Jasmine to Jest - Itenium","og_description":"Jasmine vs JestWhen you search \u201cJasmine vs Jest\u201d, you get a lot of high level comparisons which might be helpful when you have yet to write your first test. This is no such article, this is the article that answers the questionWhat are the actual syntax and API differences between Jasmine and Jest?Head to the bottom of the article for the tl;dr difference table or for the slick VSCode integration.","og_url":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/","og_site_name":"Itenium","article_published_time":"2023-04-01T01:00:00+00:00","article_modified_time":"2025-11-28T12:31:43+00:00","og_image":[{"width":360,"height":300,"url":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png","type":"image\/png"}],"author":"Usdevelop","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Usdevelop","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/","url":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/","name":"JavaScript Testing: Jasmine to Jest - Itenium","isPartOf":{"@id":"https:\/\/demo.sidekick.be\/itenium\/#website"},"primaryImageOfPage":{"@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#primaryimage"},"image":{"@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#primaryimage"},"thumbnailUrl":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png","datePublished":"2023-04-01T01:00:00+00:00","dateModified":"2025-11-28T12:31:43+00:00","author":{"@id":"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022"},"breadcrumb":{"@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#primaryimage","url":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png","contentUrl":"https:\/\/demo.sidekick.be\/itenium\/wp-content\/uploads\/2025\/11\/jasmine-to-jest.png","width":360,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/demo.sidekick.be\/itenium\/blog\/javascript\/javascript-testing-jasmine-to-jest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/demo.sidekick.be\/itenium\/"},{"@type":"ListItem","position":2,"name":"JavaScript Testing: Jasmine to Jest"}]},{"@type":"WebSite","@id":"https:\/\/demo.sidekick.be\/itenium\/#website","url":"https:\/\/demo.sidekick.be\/itenium\/","name":"Itenium","description":"We build software. We build careers.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/demo.sidekick.be\/itenium\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/6ab401ce01e858184ee4a8667fe0f022","name":"Usdevelop","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/demo.sidekick.be\/itenium\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc8cf9b9e9d5bbe7e8d247907cc9ac8457bbfa2854b52eaddf6529adfe88ceab?s=96&d=mm&r=g","caption":"Usdevelop"},"sameAs":["https:\/\/demo.sidekick.be\/itenium"]}]}},"_links":{"self":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts\/1515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/comments?post=1515"}],"version-history":[{"count":3,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts\/1515\/revisions"}],"predecessor-version":[{"id":2280,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/posts\/1515\/revisions\/2280"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/media\/2043"}],"wp:attachment":[{"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/media?parent=1515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/categories?post=1515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demo.sidekick.be\/itenium\/wp-json\/wp\/v2\/tags?post=1515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}