PageSourceSearch

https://stryker-mutator.io/assets/js/4000ee14.7490fd26.js

js stryker-mutator.io collected 2026-09-24 17:53:48 UTC 9,079 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkstryker_mutator_github_io=self.webpackChunkstryker_mutator_github_io||[]).push([["3383"],{41804:function(e,t,r){r.r(t),r.d(t,{assets:function(){return l},contentTitle:function(){return i},default:function(){return h},frontMatter:function(){return a},metadata:function(){return s},toc:function(){return c}});var s=r(77082),n=r(91987),o=r(67008);let a={slug:"use-git-to-select-files",title:"Use git to select files",authors:"nicojs",tags:["stryker-js"]},i,l={authorsImageUrls:[void 0]},c=[{value:"Sandboxes",id:"sandboxes",level:2},{value:"Remove your <code>files</code> configuration",id:"remove-your-files-configuration",level:2},{value:"Breaking change!",id:"breaking-change",level:2},{value:"What&#39;s next?",id:"whats-next",level:2}];function u(e){let t={a:"a",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.p,{children:"The 0.21 release of Stryker simplifies configuration by using your git database."}),"\n","\n",(0,n.jsx)(t.p,{children:"For a change log per package:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker/CHANGELOG.md",children:"stryker changelog"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-api/CHANGELOG.md",children:"stryker-api changelog"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-mocha-runner/CHANGELOG.md",children:"stryker-mocha-runner changelog"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-karma-runner/CHANGELOG.md",children:"stryker-karma-runner changelog"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-typescript/CHANGELOG.md",children:"stryker-typescript changelog"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-webpack-transpiler/CHANGELOG.md",children:"stryker-webpack-transpiler changelog"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"sandboxes",children:"Sandboxes"}),"\n",(0,n.jsxs)(t.p,{children:["Stryker only works on copies of your source code. A copy is called a ",(0,n.jsx)(t.em,{children:"sandbox"}),". It creates as much of them as you want parallel test runners.\nYou don't want a big sandbox. Just imagine what would happen if all your node_modules end up in there! That's why Stryker allows you to configure\nthe files to load into it."]}),"\n",(0,n.jsxs)(t.p,{children:["One of the most common issues in ",(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/issues",children:"our issue tracker"})," has to do with\nthe way you needed to configure it using the ",(0,n.jsx)(t.code,{children:"files"})," configuration. It was very confusing. The fact that stryker-karma-runner (pre 0.13) and stryker-typescript (pre 0.10)\nmodified your files array (without you knowing it) only added to the complexity.\nJust ",(0,n.jsx)(t.a,{href:"https://github.com/nicojs/angular-stryker-example/blob/72d85e19657247a77faa8e12587d3d301147b2bd/stryker.conf.js#L6",children:"a small look at the angular example file"}),"\nwill leave you scratching your head."]}),"\n",(0,n.jsxs)(t.p,{children:["Further more, you had properties like ",(0,n.jsx)(t.code,{children:"included"}),", ",(0,n.jsx)(t.code,{children:"transpiled"})," and ",(0,n.jsx)(t.code,{children:"mutated"}),". It was kind of a mess really."]}),"\n",(0,n.jsxs)(t.h2,{id:"remove-your-files-configuration",children:["Remove your ",(0,n.jsx)(t.code,{children:"files"})," configuration"]}),"\n",(0,n.jsxs)(t.p,{children:["No longer! From release 0.21 of Stryker, the files array is ",(0,n.jsx)(t.em,{children:"optional"}),". Please remove it. Everything should work as expected.\nStryker will fallback to a sane default: your git database. It does this by executing the following command:\n",(0,n.jsx)(t.code,{children:"git ls-files --others --exclude-standard --cached"}),". The result should be exactly what you want in your sandbox\n(given you're using ",(0,n.jsx)(t.code,{children:".gitignore"})," files like a boss). If you want to deviate from this for whatever reason,\nyou can still use the ",(0,n.jsx)(t.code,{children:"files"}
1)," property with an array of strings."]}),"\n",(0,n.jsxs)(t.p,{children:["Stryker also stopped keeping track of ",(0,n.jsx)(t.code,{children:"included"}),", ",(0,n.jsx)(t.code,{children:"transpiled"})," and ",(0,n.jsx)(t.code,{children:"mutated"})," properties. For ",(0,n.jsx)(t.code,{children:"mutate"})," please use the\ndesignated ",(0,n.jsxs)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/tree/master/packages/stryker#source-code-files-to-mutate",children:[(0,n.jsx)(t.code,{children:"mutate"})," top level stryker property"]}),"."]}),"\n",(0,n.jsx)(t.h2,{id:"breaking-change",children:"Breaking change!"}),"\n",(0,n.jsxs)(t.p,{children:["Unfortunately we couldn't create this feature without some breaking changes. The biggest one is that we've had to remove the old\n",(0,n.jsx)(t.code,{children:"InputFileDescriptor"})," object way of defining your input file."]}),"\n",(0,n.jsx)(t.p,{children:"This:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-js",children:"// DEPRECATED\nfiles: [{ pattern: 'pattern', included: true, mutated: true, transpiled: true }];\n"})}),"\n",(0,n.jsxs)(t.p,{children:["Is deprecated. If you are using it we strongly suggest to try to remove ",(0,n.jsx)(t.code,{children:"files"})," entirely."]}),"\n",(0,n.jsx)(t.p,{children:"We've had to update the API to test runner plugins and transpiler plugins as well. Before, Stryker was keeping track of which file\nneeded to be included in the test runner or transpiled by the transpiler. This is\nno longer the case. To see what this means for you, please consult the readme of the plugins you are using:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-mocha-runner/README.md",children:"stryker-mocha-runner readme"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-karma-runner/README.md",children:"stryker-karma-runner readme"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-typescript/README.md",children:"stryker-typescript readme"})}),"\n",(0,n.jsx)(t.li,{children:(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/blob/master/packages/stryker-webpack-transpiler/README.md",children:"stryker-webpack-transpiler readme"})}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"whats-next",children:"What's next?"}),"\n",(0,n.jsxs)(t.p,{children:["With this major refactoring out of the way we will hone in to our next target: an actual v1 release.\nWe've opened up ",(0,n.jsx)(t.a,{href:"https://github.com/stryker-mutator/stryker-js/issues/654",children:"issue 654"})," to keep track of our\nprogress on this front. Want to help? Or curious about our plans? Please get in touch."]})]})}function h(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(u,{...e})}):u(e)}},67008:function(e,t,r){r.d(t,{R:function(){return a},x:function(){return i}});var s=r(71763);let n={},o=s.createContext(n);function a(e){let t=s.useContext(o);return s.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function i(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:a(e.components),s.createElement(o.Provider,{value:t},e.children)}},77082:function(e){e.exports=JSON.parse('{"permalink":"/blog/use-git-to-select-files","editUrl":"https://github.com/stryker-mutator/stryker-mutator.github.io/edit/develop/blog/2018-04-04-use-git-to-select-files.mdx","source":"@site/blog/2018-04-04-use-git-to-select-files.mdx","title":"Use git to select files","description":"The 0.21 release of Stryker simplifies configuration by using your git database.","date":"2018-04-04T00:00:00.000Z","tags":[{"inline":true,"label":"stryker-js","permalink":"/blog/tags/stryker-js"}],"readingTime":3.22,"hasTruncateMarker":true,"authors":[{"name":"Nico Jansen","title":"Stryker Team","socials":{"github":"https://github.com/nicojs","x":"https://x.com/_nicojs"},"imageURL":"https://avatars.githubusercontent.com/u/1828233","key":"nicojs","page":null}],"frontMatter":{"slug":"use-git-to-select-files","title":"Use git to select files","authors":"nicojs","tags":["stryker-js"]},"unlisted":false,"prevItem":{"title":"Introducing Stryker.NET and Stryker4s","permalink":"/blog/csharp-and-scala-support"},"nextItem":{"title":"Get your mutation score badge now!","permalink":"/blog/get-your-mutation-score-badge-now"}}')}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.