Files
react-native-community-cli/jest/__tests__/replaceProjectRootInOutput.test.ts
TMaszkoandMichał Pierzchała 9e44835025 fix: invalid output from config command (#1131)
* Moved disabling logger at the top when user used config command

* Added e2e tests for config command

* Added config command output snapshot

* Updated config test snapshot

* Added project root replacement helper

* Removed default terminal program from snapshots

* Moved tests to jest folder and removed additional snapshot

* less snapshots; use raw serializer

* strip unnecessary parts of the snapshot

* Added tmp directory to regex which replaces project root before snapshot

* Added slash before passing testFolder for project root replacing helper

* Fixed problem with windows paths replacing

* CR fixes

Co-authored-by: Michał Pierzchała <[email protected]>
2020-04-29 10:26:30 +02:00

15 lines
488 B
TypeScript

import {replaceProjectRootInOutput} from '../helpers';
test('should replace project root in output with <<REPLACED_ROOT>> value', () => {
const cwd = '/var/folders/zt/917v0jxx6lg3p_zfh9s_02bm0000gn/T/';
const output = `{
"root": "/private${cwd}/test_root/TestProject",
}`;
const outputWithReplacedProjectRoot = `{
"root": "<<REPLACED_ROOT>>/test_root/TestProject",
}`;
expect(replaceProjectRootInOutput(output, cwd)).toBe(
outputWithReplacedProjectRoot,
);
});