fix(NA): @kbn/utils build on windows native environment (#120317) (#120367)

* fix(NA): @kbn/utils build on windows native environment

* chore(NA): remove circular dep from @kbn/utils
This commit is contained in:
Tiago Costa 2021-12-03 17:17:59 +00:00 committed by GitHub
parent d40fb7621e
commit 68285a8960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,10 +7,17 @@
*/
import { accessSync, constants } from 'fs';
import { createAbsolutePathSerializer } from '@kbn/dev-utils';
import { getConfigPath, getDataPath, getLogsPath, getConfigDirectory } from './';
import { REPO_ROOT } from '../repo_root';
expect.addSnapshotSerializer(createAbsolutePathSerializer());
expect.addSnapshotSerializer(
((rootPath: string = REPO_ROOT, replacement = '<absolute path>') => {
return {
test: (value: any) => typeof value === 'string' && value.startsWith(rootPath),
serialize: (value: string) => value.replace(rootPath, replacement).replace(/\\/g, '/'),
};
})()
);
describe('Default path finder', () => {
it('should expose a path to the config directory', () => {