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

* 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 15:59:02 +00:00 committed by GitHub
parent a0db43e07b
commit 2c4b1ff371
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', () => {