This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
/
debug.ts
39 lines (33 loc) · 1.58 KB
/
debug.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
declare var require: any;
import pnp from "../src/pnp";
import { Logger, LogLevel, ConsoleListener } from "../src/utils/logging";
import { NodeFetchClient } from "../src/net/nodefetchclient";
// setup the connection to SharePoint using the settings file, you can
// override any of the values as you want here, just be sure not to commit
// your account details :)
// if you don't have a settings file defined this will error
// you can comment it out and put the values here directly, or better yet
// create a settings file using settings.example.js as a template
const settings = require("../../settings.js");
// configure your node options
pnp.setup({
sp: {
fetchClientFactory: () => {
return new NodeFetchClient(settings.testing.siteUrl, settings.testing.clientId, settings.testing.clientSecret);
},
},
});
// setup console logger
Logger.subscribe(new ConsoleListener());
// change this to LogLevel.Verbose for more details about the request
Logger.activeLogLevel = LogLevel.Info;
// importing the example debug scenario and running it
// adding your debugging to other files and importing them will keep them out of git
// PRs updating the debug.ts or example.ts will not be accepted unless they are fixing bugs
// add your debugging imports here and prior to submitting a PR git checkout debug/debug.ts
// will allow you to keep all your debugging files locally
// comment out the example
import { Example } from "./example";
Example();
// you can also set break points inside the src folder to examine how things are working
// within the library while debugging!