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:
Darshan Sen 2021-06-21 10:35:28 +05:30 committed by GitHub
parent e7ae6edbd4
commit cfc846a337
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
}); });
}); });