git ssb

0+

cel-desktop / ssb-pkg



Tree: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44

Files: c5c7a8ffadbd51aa28a5f3f096fe43f69405da44 / test / test-79-npm / kerberos / kerberos.js

979 bytesRaw
1'use strict';
2
3function isModuleNotFoundError (error) {
4 return ((error.code === 'MODULE_NOT_FOUND') &&
5 (error.message.indexOf('build/Release/kerberos') >= 0));
6}
7
8var kerberos;
9
10function hideTryBlockFromBundleDetectorIgnoreFlag () {
11 kerberos = require('kerberos');
12}
13
14try {
15 hideTryBlockFromBundleDetectorIgnoreFlag();
16} catch (error) {
17 if (!isModuleNotFoundError(error)) {
18 console.log('bad1', error);
19 return;
20 }
21}
22
23var sspi;
24
25function hideTryBlockFromBundleDetectorIgnoreFlag2 () {
26 sspi = require('kerberos/lib/sspi');
27}
28
29try {
30 if (process.platform === 'win32') {
31 hideTryBlockFromBundleDetectorIgnoreFlag2();
32 }
33} catch (error) {
34 if (!isModuleNotFoundError(error)) {
35 console.log('bad2', error);
36 return;
37 }
38}
39
40if (kerberos) {
41 if (typeof kerberos.Kerberos !== 'function') {
42 console.log('bad');
43 return;
44 }
45}
46
47if (sspi) {
48 if (typeof sspi.SSPI !== 'function') {
49 console.log('bad');
50 return;
51 }
52}
53
54console.log('ok');
55

Built with git-ssb-web