fix: relax app.getLocaleCountryCode() test (#29679)
If the app is run with LC_ALL=C on Linux, the test would fail as app.getLocaleCountryCode() would return "". Signed-off-by: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
parent
e7ae6edbd4
commit
cfc846a337
1 changed files with 3 additions and 6 deletions
|
@ -122,12 +122,9 @@ describe('app module', () => {
|
||||||
|
|
||||||
describe('app.getLocaleCountryCode()', () => {
|
describe('app.getLocaleCountryCode()', () => {
|
||||||
it('should be empty or have length of two', () => {
|
it('should be empty or have length of two', () => {
|
||||||
let expectedLength = 2;
|
const localeCountryCode = app.getLocaleCountryCode();
|
||||||
if (process.platform === 'linux' && process.env.CI) {
|
expect(localeCountryCode).to.be.a('string');
|
||||||
// Linux CI machines have no locale.
|
expect(localeCountryCode.length).to.be.oneOf([0, 2]);
|
||||||
expectedLength = 0;
|
|
||||||
}
|
|
||||||
expect(app.getLocaleCountryCode()).to.be.a('string').and.have.lengthOf(expectedLength);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue