microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7b48f26eb8caae7ed9cc1a09249195dfed76fa76

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

test/localization/index.ts

38lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as path from "path";
5import Mocha = require("mocha");
6
7export async function run(): Promise<void> {
8 const mocha = new Mocha({
9 ui: "tdd",
10 grep: RegExp("localizationContext"),
11 reporter: "mocha-multi-reporters",
12 reporterOptions: {
13 reporterEnabled: "spec, mocha-junit-reporter",
14 mochaJunitReporterReporterOptions: {
15 mochaFile: path.join(__dirname, "..", "LocalizationTests.xml"),
16 },
17 },
18 color: true,
19 });
20
21 // Register Mocha options
22 return new Promise((resolve, reject) => {
23 mocha.addFile(path.resolve(__dirname, "localization.test.js"));
24
25 try {
26 // Run the mocha test
27 mocha.run((failures: any) => {
28 if (failures > 0) {
29 reject(new Error(`${failures} tests failed.`));
30 } else {
31 resolve();
32 }
33 });
34 } catch (err) {
35 reject(err);
36 }
37 });
38}
39