back to mocha, working in future node versions

This commit is contained in:
VitoAlbano
2024-07-05 12:27:33 +01:00
parent 764633e8fe
commit 2611b81650
5 changed files with 111 additions and 11 deletions

View File

@@ -53,7 +53,13 @@ describe('Oauth2 Implicit flow test', () => {
});
it('should redirect to login if access token is not valid', (done) => {
window = globalAny.window = { location: {} };
window = globalAny.window = {
location: {
assign: (v: any) => {
window.location.href = v;
}
}
};
globalAny.document = {
getElementById: () => ''
};
@@ -81,7 +87,13 @@ describe('Oauth2 Implicit flow test', () => {
});
it('should not loop over redirection when redirectUri contains hash and token is not valid ', (done) => {
window = globalAny.window = { location: {} };
window = globalAny.window = {
location: {
assign: (v: any) => {
window.location.href = v;
}
}
};
globalAny.document = {
getElementById: () => ''
};
@@ -112,7 +124,13 @@ describe('Oauth2 Implicit flow test', () => {
});
it('should not redirect to login if access token is valid', (done) => {
window = globalAny.window = { location: {} };
window = globalAny.window = {
location: {
assign: (v: any) => {
window.location.href = v;
}
}
};
globalAny.document = {
getElementById: () => ''
};
@@ -144,11 +162,17 @@ describe('Oauth2 Implicit flow test', () => {
});
it('should set the loginFragment to redirect after the login if it is present', (done) => {
window = globalAny.window = {};
window = globalAny.window = {
location: {
assign: (v: any) => {
window.location.href = v;
}
}
};
globalAny.document = {
getElementById: () => ''
};
window.location = <Location>{ hash: 'asfasfasfa' };
window.location.hash = 'asfasfasfa';
Object.defineProperty(window.location, 'hash', {
writable: true,

View File

@@ -8,7 +8,6 @@
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"types": ["mocha"]
"skipDefaultLibCheck": true
}
}