diff --git a/scripts/utils/createJestConfig.js b/scripts/utils/createJestConfig.js
index ee2f9652bd74e3e6d4d3c8d1f7a6a42675cfb92e..ae5ed4f8596e84df89103840c8cff2c28b657241 100644
--- a/scripts/utils/createJestConfig.js
+++ b/scripts/utils/createJestConfig.js
@@ -15,7 +15,9 @@ const paths = require('../../config/paths');
 module.exports = (resolve, rootDir) => {
   const setupFiles = [resolve('config/polyfills.js')];
   if (pathExists.sync(paths.testsSetup)) {
-    setupFiles.push(paths.testsSetup);
+    // Use this instead of `paths.testsSetup` to avoid putting
+    // an absolute filename into configuration after ejecting.
+    setupFiles.push('<rootDir>/src/setupTests.js');
   }
 
   const config = {