Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 9e49402

Browse files
bump demo to N6
1 parent 5bda170 commit 9e49402

File tree

4 files changed

+55
-23
lines changed

4 files changed

+55
-23
lines changed

demo/app/main-view-model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ export class HelloWorldModel extends Observable {
395395
crashlyticsCollectionEnabled: true,
396396
// storageBucket: 'gs://n-plugin-test.appspot.com',
397397
persist: true, // optional, default false
398-
// analyticsCollectionEnabled: false, // default true
398+
analyticsCollectionEnabled: false, // default true
399399
onAuthStateChanged: data => { // optional
400400
console.log((data.loggedIn ? "Logged in to firebase" : "Logged out from firebase") + " (init's onAuthStateChanged callback)");
401401
if (data.loggedIn) {

demo/karma.conf.js

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = function (config) {
2-
config.set({
2+
const options = {
33

44
// base path that will be used to resolve all patterns (eg. files, exclude)
55
basePath: '',
@@ -11,18 +11,18 @@ module.exports = function (config) {
1111

1212

1313
// list of files / patterns to load in the browser
14-
files: [
15-
'app/**/*.js'
16-
],
14+
files: ['app/tests/**/*.*'],
1715

1816

1917
// list of files to exclude
20-
exclude: [],
18+
exclude: [
19+
],
2120

2221

2322
// preprocess matching files before serving them to the browser
2423
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
25-
preprocessors: {},
24+
preprocessors: {
25+
},
2626

2727

2828
// test results reporter to use
@@ -70,6 +70,39 @@ module.exports = function (config) {
7070

7171
// Continuous Integration mode
7272
// if true, Karma captures browsers, runs the tests and exits
73-
singleRun: true
74-
});
75-
};
73+
singleRun: false
74+
};
75+
76+
setWebpackPreprocessor(config, options);
77+
setWebpack(config, options);
78+
79+
config.set(options);
80+
}
81+
82+
function setWebpackPreprocessor(config, options) {
83+
if (config && config.bundle) {
84+
if (!options.preprocessors) {
85+
options.preprocessors = {};
86+
}
87+
88+
options.files.forEach(file => {
89+
if (!options.preprocessors[file]) {
90+
options.preprocessors[file] = [];
91+
}
92+
options.preprocessors[file].push('webpack');
93+
});
94+
}
95+
}
96+
97+
function setWebpack(config, options) {
98+
if (config && config.bundle) {
99+
const env = {};
100+
env[config.platform] = true;
101+
env.sourceMap = config.debugBrk;
102+
options.webpack = require('./webpack.config')(env);
103+
delete options.webpack.entry;
104+
delete options.webpack.output.libraryTarget;
105+
const invalidPluginsForUnitTesting = ["GenerateBundleStarterPlugin", "GenerateNativeScriptEntryPointsPlugin"];
106+
options.webpack.plugins = options.webpack.plugins.filter(p => !invalidPluginsForUnitTesting.includes(p.constructor.name));
107+
}
108+
}

demo/nsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
22
"appPath": "app",
3-
"appResourcesPath": "app_resources",
4-
"useLegacyWorkflow": false
5-
}
3+
"appResourcesPath": "app_resources"
4+
}

demo/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
"nativescript": {
33
"id": "org.nativescript.firebasedemo",
44
"tns-ios": {
5-
"version": "5.4.2"
5+
"version": "6.0.1"
66
},
77
"tns-android": {
8-
"version": "5.4.0"
8+
"version": "6.0.0"
99
}
1010
},
1111
"dependencies": {
1212
"firebase-functions": "^2.0.5",
1313
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-9.0.3.tgz",
1414
"nativescript-theme-core": "^1.0.4",
15-
"nativescript-unit-test-runner": "^0.3.4",
16-
"tns-core-modules": "~5.4.0"
15+
"nativescript-unit-test-runner": "0.7.0",
16+
"tns-core-modules": "6.0.1"
1717
},
1818
"devDependencies": {
1919
"@types/jasmine": "~2.8.0",
@@ -22,16 +22,16 @@
2222
"babylon": "6.8.4",
2323
"filewalker": "0.1.2",
2424
"jasmine-core": "~2.8.0",
25-
"karma": "^1.7.1",
26-
"karma-jasmine": "^1.1.0",
25+
"karma": "4.1.0",
26+
"karma-jasmine": "2.0.1",
2727
"karma-nativescript-launcher": "^0.4.0",
2828
"lazy": "1.0.11",
2929
"nativescript-css-loader": "~0.26.0",
30-
"nativescript-dev-typescript": "~0.7.1",
31-
"nativescript-dev-webpack": "~0.24.1",
32-
"tns-platform-declarations": "~5.4.0",
30+
"nativescript-dev-webpack": "1.0.1",
31+
"tns-platform-declarations": "6.0.1",
3332
"tslint": "~5.4.3",
34-
"typescript": "~2.8.0"
33+
"typescript": "3.4.5",
34+
"karma-webpack": "3.0.5"
3535
},
3636
"scripts": {
3737
"build.plugin": "cd ../src && npm run build",

0 commit comments

Comments
 (0)