Skip to content

Commit 9fb9e1f

Browse files
Fix browser tests
1 parent 6c893ca commit 9fb9e1f

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

config/webpack.test.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @license
3-
* Copyright 2017 Google Inc.
3+
* Copyright 2017 Google LLC
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -52,6 +52,28 @@ module.exports = {
5252
enforce: 'post',
5353
exclude: [/\.test\.ts$/, /\btest(ing)?\//]
5454
},
55+
{
56+
test: /packages\/firestore\/.*\.tsx?$/,
57+
use: {
58+
loader: 'string-replace-loader',
59+
options: {
60+
multiple: [
61+
{
62+
search: '/platform/platform',
63+
replace: '/platform_browser/browser_platform'
64+
},
65+
{
66+
search: '/platform/format_json',
67+
replace: '/platform_browser/browser_format_json'
68+
},
69+
{
70+
search: '/platform/random_bytes',
71+
replace: '/platform_browser/browser_random_bytes'
72+
}
73+
]
74+
}
75+
}
76+
},
5577
{
5678
test: /\.js$/,
5779
include: [/node_modules\/chai-as-promised/],

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
"sinon": "9.0.2",
130130
"sinon-chai": "3.5.0",
131131
"source-map-loader": "0.2.4",
132+
"string-replace-loader": "2.3.0",
132133
"terser": "4.6.13",
133134
"ts-loader": "6.2.2",
134135
"ts-node": "8.10.1",

packages/firestore/test/unit/bootstrap.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* limitations under the License.
1616
*/
1717

18-
import '../../src/platform_browser/browser_init';
19-
2018
/**
2119
* This will include all of the test files and compile them as needed
2220
*

yarn.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13387,6 +13387,14 @@ string-length@^1.0.0:
1338713387
dependencies:
1338813388
strip-ansi "^3.0.0"
1338913389

13390+
13391+
version "2.3.0"
13392+
resolved "https://registry.npmjs.org/string-replace-loader/-/string-replace-loader-2.3.0.tgz#7f29be7d73c94dd92eccd5c5a15651181d7ecd3d"
13393+
integrity sha512-HYBIHStViMKLZC/Lehxy42OuwsBaPzX/LjcF5mkJlE2SnHXmW6SW6eiHABTXnY8ZCm/REbdJ8qnA0ptmIzN0Ng==
13394+
dependencies:
13395+
loader-utils "^1.2.3"
13396+
schema-utils "^2.6.5"
13397+
1339013398
string-width@^1.0.1, string-width@^1.0.2:
1339113399
version "1.0.2"
1339213400
resolved "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"

0 commit comments

Comments
 (0)