mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-21 10:58:14 +00:00
Stabilize interactive dialogs, custom status clear, bookmarks, pin waits, and mm_blocks long-press; soft-fail and hard-budget the Cloudflare sidecar so tunnel DNS hangs no longer stall shards. Co-authored-by: Cursor <cursoragent@cursor.com>
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
const path = require('path');
|
|
|
|
const sanitizeFilename = require('sanitize-filename');
|
|
|
|
const SANITIZE_OPTIONS = {replacement: '_'};
|
|
|
|
// `/` is illegal in filesystem paths. sanitize-filename turns it into `_`, which
|
|
// breaks TSIO screenshot linking (folder basename must match Jest fullName).
|
|
// Use U+2215 DIVISION SLASH so the folder stays unique and TSIO can reverse it.
|
|
const PATH_SEP_TOKEN = '\u2215';
|
|
const sanitize = (filename) => sanitizeFilename(
|
|
String(filename).replaceAll('/', PATH_SEP_TOKEN),
|
|
SANITIZE_OPTIONS,
|
|
);
|
|
|
|
class CustomPathBuilder {
|
|
constructor({rootDir}) {
|
|
this.rootDir = rootDir;
|
|
}
|
|
|
|
buildPathForTestArtifact(artifactName, testSummary = null) {
|
|
const fullName = (testSummary && testSummary.fullName) || '';
|
|
const segments = [this.rootDir, sanitize(fullName), sanitize(artifactName)];
|
|
return path.join(...segments.filter(Boolean));
|
|
}
|
|
}
|
|
|
|
module.exports = ({rootDir}) => {
|
|
return new CustomPathBuilder({rootDir});
|
|
};
|