Skip to content

Commit

Permalink
Tracer web (open-telemetry#334)
Browse files Browse the repository at this point in the history
* feat(tracer-web): adding tracer web

* feat(basic-tracer): adding karma tests

* feat(tracer-web): adding some example for easier debugging in browser - for development purposes

* fix: lint

* fix: creating base for karma

* fix: fixing problem with target for browser, cleanup tests

* refactor: moving polyfills for node karma tests to one file

* fix: adding missing package

* refactor: removing unneeded file

* refactor: prefixing privates, cleanup

* fix: duplicate package

* refactor: aligning tslint with other tslint packages

* refactor: cleanups, adding comments for class

* fix: linting

* fix: type

* refactor: generation of id for scope

* refactor: removed previous uid for scope as originally it was meant to be used with async which is not the case anymore

* chore: adding test for restoring scope

* fix: lint

* refactor: simplifying the stack scope manager

* chore: updating readme with basic example

* chore: fixes after merge

* fix: updating test to accept greater or equal - fails on browser

* refactor: moving example for web tracer

* refactor: removing WebTracerConfig to use BasicTracerConfig which changed recently

* chore: updating types

* chore: spacing

* chore: removing mocha tests for tracer-web

* chore: updating types and linting

* chore: updating packages after merge

* chore: adding nyc report for karma tests for browser

* chore: updating lerna script to run coverage for browsers

* feat(tracer-web): bump version to 0.1.0
  • Loading branch information
obecny authored and dyladan committed Feb 18, 2021
1 parent 94c9aba commit 83fffb0
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
26 changes: 26 additions & 0 deletions api/karma.base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*!
* Copyright 2019, OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

module.exports = {
listenAddress: 'localhost',
hostname: 'localhost',
browsers: ['ChromeHeadless'],
frameworks: ['mocha'],
reporters: ['spec'],
files: ['test/index-webpack.ts'],
preprocessors: { 'test/index-webpack.ts': ['webpack'] },
webpackMiddleware: { noInfo: true }
};
52 changes: 52 additions & 0 deletions api/webpack.node-polyfills.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = {
// Enable the assert library polyfill because that is used in tests
assert: true,
// The assert polyfill from github.com/browserify/commonjs-assert
// also requires the `global` polyfill.
global: true,

// Turn off all other Node.js API polyfills for the browser tests to
// make sure that we are not attempting to use Node-specific APIs in
// the browser code. Instead, we will write browser specific
// implementations of platform functionality we need under the
// `./src/platform/browser` folder. This allows for writing browser
// optimized implementations of the specific needed functionality
// rather than bringing in (sometimes large) polyfills for the
// corresponding Node APIs.
Buffer: false,
__dirname: false,
__filename: false,
buffer: false,
child_process: false,
cluster: false,
console: false,
constants: false,
crypto: false,
dgram: false,
dns: false,
domain: false,
events: false,
fs: false,
http: false,
https: false,
module: false,
net: false,
os: false,
path: false,
process: false,
punycode: false,
querystring: false,
readline: false,
repl: false,
setImmediate: false,
stream: false,
string_decoder: false,
sys: false,
timers: false,
tls: false,
tty: false,
url: false,
util: false,
vm: false,
zlib: false
};

0 comments on commit 83fffb0

Please sign in to comment.