Fix relative paths in tests, part 1 (#40420)

* Fix relative paths in tests, attempt 1

* revert athenajs change
This commit is contained in:
Nathan Shively-Sanders
2019-11-15 09:19:40 -08:00
committed by GitHub
parent 9314b64275
commit 12c3ce0d4f
81 changed files with 149 additions and 150 deletions
-1
View File
@@ -1,4 +1,3 @@
import { EscapeCode } from './escape-code';
import AnsiStyles = require('ansi-styles');
let ansiStyles = AnsiStyles as any,
@@ -1,4 +1,4 @@
import "./index";
import "baidumap-web-sdk";
class TestFixture {
// document: http://lbsyun.baidu.com/index.php?title=jspopular3.0
+1 -1
View File
@@ -1,4 +1,4 @@
import '../behavior3';
import 'behavior3';
// Test decode
const blackboard = new b3.Blackboard();
+2 -2
View File
@@ -1,5 +1,5 @@
import { ApplePay } from "..";
import * as braintree from "..";
import { ApplePay } from "braintree-web";
import * as braintree from "braintree-web";
let version: string = braintree.VERSION;
@@ -3,7 +3,7 @@
// Definitions by: Jim Bouquet <https://github.com/ClearBlade>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { ClearBlade, Resp, QuerySortDirections, QueryConditions } from ".";
import { ClearBlade, Resp, QuerySortDirections, QueryConditions } from "clearbladejs-node";
// Sample code for clearbladejs Node SDK v1.0.0 used to test typescript definitions
+2 -2
View File
@@ -1,7 +1,7 @@
import * as config from "config";
import { deferConfig } from './defer';
import { raw } from './raw';
import { deferConfig } from 'config/defer';
import { raw } from 'config/raw';
var class1: config.IConfig = config;
+44 -44
View File
@@ -1,55 +1,55 @@
import Core = require('../core');
import X64Core = require('../x64-core');
import LibTypedarrays = require('../lib-typedarrays');
import Core = require('crypto-js/core');
import X64Core = require('crypto-js/x64-core');
import LibTypedarrays = require('crypto-js/lib-typedarrays');
// ---
import MD5 = require('../md5');
import SHA1 = require('../sha1');
import SHA256 = require('../sha256');
import SHA224 = require('../sha224');
import SHA512 = require('../sha512');
import SHA384 = require('../sha384');
import SHA3 = require('../sha3');
import RIPEMD160 = require('../ripemd160');
import MD5 = require('crypto-js/md5');
import SHA1 = require('crypto-js/sha1');
import SHA256 = require('crypto-js/sha256');
import SHA224 = require('crypto-js/sha224');
import SHA512 = require('crypto-js/sha512');
import SHA384 = require('crypto-js/sha384');
import SHA3 = require('crypto-js/sha3');
import RIPEMD160 = require('crypto-js/ripemd160');
// ---
import HmacMD5 = require('../hmac-md5');
import HmacSHA1 = require('../hmac-sha1');
import HmacSHA256 = require('../hmac-sha256');
import HmacSHA224 = require('../hmac-sha224');
import HmacSHA512 = require('../hmac-sha512');
import HmacSHA384 = require('../hmac-sha384');
import HmacSHA3 = require('../hmac-sha3');
import HmacRIPEMD160 = require('../hmac-ripemd160');
import HmacMD5 = require('crypto-js/hmac-md5');
import HmacSHA1 = require('crypto-js/hmac-sha1');
import HmacSHA256 = require('crypto-js/hmac-sha256');
import HmacSHA224 = require('crypto-js/hmac-sha224');
import HmacSHA512 = require('crypto-js/hmac-sha512');
import HmacSHA384 = require('crypto-js/hmac-sha384');
import HmacSHA3 = require('crypto-js/hmac-sha3');
import HmacRIPEMD160 = require('crypto-js/hmac-ripemd160');
// ---
import PBKDF2 = require('../pbkdf2');
import PBKDF2 = require('crypto-js/pbkdf2');
// ---
import AES = require('../aes');
import TripleDES = require('../tripledes');
import RC4 = require('../rc4');
import Rabbit = require('../rabbit');
import RabbitLegacy = require('../rabbit-legacy');
import EvpKDF = require('../evpkdf');
import AES = require('crypto-js/aes');
import TripleDES = require('crypto-js/tripledes');
import RC4 = require('crypto-js/rc4');
import Rabbit = require('crypto-js/rabbit');
import RabbitLegacy = require('crypto-js/rabbit-legacy');
import EvpKDF = require('crypto-js/evpkdf');
// ---
import FormatOpenSSL = require('../format-openssl');
import FormatHex = require('../format-hex');
import FormatOpenSSL = require('crypto-js/format-openssl');
import FormatHex = require('crypto-js/format-hex');
// ---
import EncLatin1 = require('../enc-latin1');
import EncUtf8 = require('../enc-utf8');
import EncHex = require('../enc-hex');
import EncUtf16 = require('../enc-utf16');
import EncBase64 = require('../enc-base64');
import EncLatin1 = require('crypto-js/enc-latin1');
import EncUtf8 = require('crypto-js/enc-utf8');
import EncHex = require('crypto-js/enc-hex');
import EncUtf16 = require('crypto-js/enc-utf16');
import EncBase64 = require('crypto-js/enc-base64');
// ---
import ModeCFB = require('../mode-cfb');
import ModeCTR = require('../mode-ctr');
import ModeCTRGladman = require('../mode-ctr-gladman');
import ModeOFB = require('../mode-ofb');
import ModeECB = require('../mode-ecb');
import ModeCFB = require('crypto-js/mode-cfb');
import ModeCTR = require('crypto-js/mode-ctr');
import ModeCTRGladman = require('crypto-js/mode-ctr-gladman');
import ModeOFB = require('crypto-js/mode-ofb');
import ModeECB = require('crypto-js/mode-ecb');
// ---
import PadPkcs7 = require('../pad-pkcs7');
import PadAnsiX923 = require('../pad-ansix923');
import PadIso10126 = require('../pad-iso10126');
import PadIso97971 = require('../pad-iso97971');
import PadZeroPadding = require('../pad-zeropadding');
import PadNoPadding = require('../pad-nopadding');
import PadPkcs7 = require('crypto-js/pad-pkcs7');
import PadAnsiX923 = require('crypto-js/pad-ansix923');
import PadIso10126 = require('crypto-js/pad-iso10126');
import PadIso97971 = require('crypto-js/pad-iso97971');
import PadZeroPadding = require('crypto-js/pad-zeropadding');
import PadNoPadding = require('crypto-js/pad-nopadding');
// Hashers
var wordArray: CryptoJS.WordArray;
+1 -1
View File
@@ -1,4 +1,4 @@
import cssbeautify = require('./index');
import cssbeautify = require('cssbeautify');
var str = '';
+1 -1
View File
@@ -1,4 +1,4 @@
import d3Cloud = require('./index.d');
import d3Cloud = require('d3-cloud');
import d3 = require('d3');
// $ExpectType Cloud<Word>
@@ -1,5 +1,5 @@
import * as moment from 'moment';
import * as EonasdanBootstrapDatetimepicker from './index';
import * as EonasdanBootstrapDatetimepicker from 'eonasdan-bootstrap-datetimepicker';
// Minimum Setup
$("#datetimepicker1").datetimepicker();
+13 -13
View File
@@ -1,17 +1,17 @@
import * as jspb from "./index";
import * as jspb from "google-protobuf";
import * as google_protobuf_compiler_plugin_pb from "./google/protobuf/compiler/plugin_pb";
import * as google_protobuf_any_pb from "./google/protobuf/any_pb";
import * as google_protobuf_api_pb from "./google/protobuf/api_pb";
import * as google_protobuf_descriptor_pb from "./google/protobuf/descriptor_pb";
import * as google_protobuf_duration_pb from "./google/protobuf/duration_pb";
import * as google_protobuf_empty_pb from "./google/protobuf/empty_pb";
import * as google_protobuf_field_mask_pb from "./google/protobuf/field_mask_pb";
import * as google_protobuf_source_context_pb from "./google/protobuf/source_context_pb";
import * as google_protobuf_struct_pb from "./google/protobuf/struct_pb";
import * as google_protobuf_timestamp_pb from "./google/protobuf/timestamp_pb";
import * as google_protobuf_type_pb from "./google/protobuf/type_pb";
import * as google_protobuf_wrappers_pb from "./google/protobuf/wrappers_pb";
import * as google_protobuf_compiler_plugin_pb from "google-protobuf/google/protobuf/compiler/plugin_pb";
import * as google_protobuf_any_pb from "google-protobuf/google/protobuf/any_pb";
import * as google_protobuf_api_pb from "google-protobuf/google/protobuf/api_pb";
import * as google_protobuf_descriptor_pb from "google-protobuf/google/protobuf/descriptor_pb";
import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb";
import * as google_protobuf_empty_pb from "google-protobuf/google/protobuf/empty_pb";
import * as google_protobuf_field_mask_pb from "google-protobuf/google/protobuf/field_mask_pb";
import * as google_protobuf_source_context_pb from "google-protobuf/google/protobuf/source_context_pb";
import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb";
import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb";
import * as google_protobuf_type_pb from "google-protobuf/google/protobuf/type_pb";
import * as google_protobuf_wrappers_pb from "google-protobuf/google/protobuf/wrappers_pb";
/* This is a typescript version of a simple generated class from a proto file that is shown below. In order to make
this ES5 JS file into TypeScript there have been quite a few modifications, but the same calls are made to the library
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servertablehost
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80, host: 'example.com' });
server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#catch-all-route
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#path-parameters
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverinfo
import * as Hapi from '../../';
import * as Hapi from 'hapi';
// added in addition to code from docs
interface PluginOptions {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#replycontinueresult
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#replyentityoptions
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#replyredirecturi
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const handler: Hapi.RouteHandler = function (request, reply) {
return reply.redirect('http://example.com');
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#replyerr-result
import * as Hapi from '../../';
import * as Hapi from 'hapi';
// verbose notation
+1 -1
View File
@@ -1,7 +1,7 @@
// from https://hapijs.com/tutorials/cookies?lang=en_US
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestsetmethodmethod
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const Crypto = require('crypto');
const server = new Hapi.Server();
server.connection({ port: 80 });
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestgenerateresponsesource-options
import * as Hapi from '../../';
import * as Hapi from 'hapi';
// Added in addition to code from docs
function promiseMethod() {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestgetlogtags-internal
import * as Hapi from '../../';
import * as Hapi from 'hapi';
declare const request: Hapi.Request;
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestlogtags-data-timestamp
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80, routes: { log: true, security: false } });
+1 -1
View File
@@ -1,6 +1,6 @@
// Added test in addition to docs, for request.query
import * as Hapi from '../../';
import * as Hapi from 'hapi';
interface GetThingQuery {
name: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestsetmethodmethod
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+2 -2
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestseturlurl-striptrailingslash
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
@@ -17,7 +17,7 @@ server.ext('onRequest', onRequest);
// Example 2
const Url = require('url');
const Qs = require('../../../../qs');
const Qs = require('hapi../../qs');
onRequest = function (request, reply) {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#requestsetmethodmethod
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#error-transformation
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+2 -2
View File
@@ -1,8 +1,8 @@
// From https://hapijs.com/api/16.1.1#error-response
import * as Hapi from '../../';
const Boom = require('../../../../boom');
import * as Hapi from 'hapi';
const Boom = require('hapi../../boom');
const server = new Hapi.Server();
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#response-events
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const Crypto = require('crypto');
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#flow-control
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const handler = function (request: Hapi.Request, reply: Hapi.ReplyWithContinue) {
@@ -1,6 +1,6 @@
'use strict';
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var authConfig: Hapi.RouteAdditionalConfigurationOptions = {
app: {},
+1 -1
View File
@@ -1,6 +1,6 @@
'use strict';
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var routeMoreConfig: Hapi.RouteAdditionalConfigurationOptions = {
auth: false,
+1 -1
View File
@@ -1,6 +1,6 @@
'use strict';
import * as Hapi from '../../';
import * as Hapi from 'hapi';
// different methods
var routeConfig: Hapi.RouteConfiguration = {
+1 -1
View File
@@ -1,6 +1,6 @@
'use strict';
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var handler: Hapi.RouteHandler = function(request, reply) {
reply('success');
+2 -2
View File
@@ -1,9 +1,9 @@
// Added in addition to code from https://hapijs.com/api/16.1.1#route-options > plugins
import * as Hapi from '../../';
import * as Hapi from 'hapi';
// In the plugin code
declare module '../../' {
declare module 'hapi' {
interface PluginSpecificConfiguration {
coolPlugin: {
optionA: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#route-prerequisites
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
@@ -1,6 +1,6 @@
'use strict';
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var route = {} as Hapi.RoutePublicInterface;
+2 -2
View File
@@ -1,8 +1,8 @@
// Added from: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16065#issuecomment-302216131
import * as Hapi from '../../';
import * as Joi from '../../../../joi';
import * as Hapi from 'hapi';
import * as Joi from 'hapi../../joi';
const validate: Hapi.RouteValidationConfigurationObject = {
headers: true,
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverapp
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var server = new Hapi.Server();
server.app.key = 'value';
+2 -2
View File
@@ -1,8 +1,8 @@
// From https://hapijs.com/api/16.1.1#serverauthapi
import * as Hapi from '../../';
import * as Boom from '../../../../boom';
import * as Hapi from 'hapi';
import * as Boom from 'hapi../../boom';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverbindcontext
import * as Hapi from '../../';
import * as Hapi from 'hapi';
interface HandlerThis {
message: string;
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servercacheoptions
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverconnectionoptions
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
const web = server.connection({ port: 8000, host: 'example.com', labels: ['web'] });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverconnections
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var server = new Hapi.Server();
server.connection({ port: 80, labels: 'a' });
server.connection({ port: 8080, labels: 'b' });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverdecoderencoding-decoder
import * as Hapi from '../../';
import * as Hapi from 'hapi';
import * as Zlib from 'zlib';
const server = new Hapi.Server();
server.connection({ port: 80, routes: { payload: { compression: { special: { chunkSize: 16 * 1024 } } } } });
+4 -4
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverdecoratetype-property-method-options
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
@@ -12,7 +12,7 @@ const success = function (this: Hapi.ReplyNoContinue) {
server.decorate('reply', 'success', success);
declare module '../../' {
declare module 'hapi' {
interface Base_Reply {
success: () => Response;
}
@@ -36,7 +36,7 @@ server.decorate('request', 'some_request_method', (request) => {
}
}, {apply: true});
declare module '../../' {
declare module 'hapi' {
interface Request {
some_request_method(): void;
}
@@ -59,7 +59,7 @@ server.decorate('server', 'some_server_method', (server: Hapi.Server) => {
}
});
declare module '../../' {
declare module 'hapi' {
interface Server {
some_server_method(arg1: number): string;
}
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverdependencydependencies-after
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const after: Hapi.AfterDependencyLoadCallback = function (server, next) {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serveremitcriteria-data-callback
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverencoderencoding-encoder
import * as Hapi from '../../';
import * as Hapi from 'hapi';
import * as Zlib from 'zlib';
const server = new Hapi.Server();
server.connection({ port: 80, routes: { compression: { special: { chunkSize: 16 * 1024 } } } });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servereventevents
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverexposekey-value
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var register: Hapi.PluginFunction<{}> = function (server, options, next) {
server.expose('util', function () { console.log('something'); });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverextevents
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+2 -2
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverhandlername-method
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ host: 'localhost', port: 8000 });
@@ -20,7 +20,7 @@ interface TestPluginConfig {
msg: string;
}
declare module '../../' {
declare module 'hapi' {
interface RouteHandlerPlugins {
test?: TestPluginConfig;
}
+1 -1
View File
@@ -2,7 +2,7 @@
// From https://hapijs.com/api/16.1.1#serverinfo
import assert = require('assert');
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
var options: Hapi.ServerConnectionOptions = { port: 80 };
server.connection(options);
+2 -2
View File
@@ -1,8 +1,8 @@
// From https://hapijs.com/api/16.1.1#serverinitializecallback
import * as Hapi from '../../';
const Hoek = require('../../../../hoek');
import * as Hapi from 'hapi';
const Hoek = require('hapi../../hoek');
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverinjectoptions-callback
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverlistener
import * as Hapi from '../../';
import * as Hapi from 'hapi';
import SocketIO = require('socket.io');
const server = new Hapi.Server();
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverload
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server({ load: { sampleInterval: 1000 } });
var d: number = server.load.rss;
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverlogtags-data-timestamp
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverlookupid
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection();
server.route({
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servermatchmethod-path-host
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection();
server.route({
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servermethodname-method-options
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servermethods
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
const add = function (a: number, b: number, next: (err: Error | null, result: number) => void) {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servermime
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const options: Hapi.ServerOptions = {
mime: {
+2 -2
View File
@@ -1,6 +1,6 @@
'use strict';
import * as Hapi from '../../';
import * as Hapi from 'hapi';
new Hapi.Server();
new Hapi.Server({
@@ -45,7 +45,7 @@ new Hapi.Server({
});
//+ Code added in addition to docs
declare module '../../' {
declare module 'hapi' {
interface PluginSpecificConfiguration {
// Set this to non optional if plugin config is non optional
'some-plugin-name'?: {options: string;};
+1 -1
View File
@@ -2,7 +2,7 @@
// From https://hapijs.com/api/16.1.1#serveroncriteria-listener
// From https://hapijs.com/api/16.1.1#server-events
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serveroncecriteria-listener
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverpathrelativeto
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var register: Hapi.PluginFunction<{}> = function (server, options, next) {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverplugins
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var registerFunction: Hapi.PluginFunction<{}> = function(server, options, next) {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverrealm
import * as Hapi from '../../';
import * as Hapi from 'hapi';
var registerFunction: Hapi.PluginFunction<{}> = function(server, options, next) {
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverregisterplugins-options-callback
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverrouteoptions
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverselectlabels
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80, labels: ['a', 'b'] });
server.connection({ port: 8080, labels: ['a', 'c'] });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serversettings
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server({
app: {
key: 'value'
+2 -2
View File
@@ -1,8 +1,8 @@
// From https://hapijs.com/api/16.1.1#serverstartcallback
import * as Hapi from '../../';
import * as Hoek from '../../../../hoek';
import * as Hapi from 'hapi';
import * as Hoek from 'hapi../../hoek';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverstatename-options
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#serverstopoptions-callback
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80 });
+1 -1
View File
@@ -1,7 +1,7 @@
// From https://hapijs.com/api/16.1.1#servertablehost
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.connection({ port: 80, host: 'example.com' });
server.route({ method: 'GET', path: '/example', handler: function (request, reply) { return reply(); } });
+1 -1
View File
@@ -1,6 +1,6 @@
// From http://hapijs.com/api#serversettings
import * as Hapi from '../../';
import * as Hapi from 'hapi';
const server = new Hapi.Server();
server.version === '8.0.0'