0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-29 15:32:40 +00:00

Merge branch 'master' into addLocalLogin-#269

This commit is contained in:
G.Ambatte
2022-03-27 17:15:41 +13:00
committed by GitHub
4 changed files with 61 additions and 14 deletions

View File

@@ -2,17 +2,23 @@
# #
# Check https://circleci.com/docs/2.0/language-javascript/ for more details # Check https://circleci.com/docs/2.0/language-javascript/ for more details
# #
version: 2 version: 2.1
orbs:
node: circleci/node@3.0.0
jobs: jobs:
build: build:
docker: docker:
- image: circleci/node:16.10.0 - image: cimg/node:16.11.0
- image: circleci/mongo:4.4 - image: mongo:4.4
working_directory: ~/repo working_directory: ~/homebrewery
executor: node/default
steps: steps:
- checkout - checkout:
path: ~/homebrewery
# Download and cache dependencies # Download and cache dependencies
- restore_cache: - restore_cache:
@@ -21,12 +27,48 @@ jobs:
# fallback to using the latest cache if no exact match is found # fallback to using the latest cache if no exact match is found
- v1-dependencies- - v1-dependencies-
- run: npm install - node/install-npm
- node/install-packages:
app-dir: ~/homebrewery
cache-path: node_modules
override-ci-command: npm i
- save_cache: - save_cache:
paths: paths:
- node_modules - node_modules
key: v1-dependencies-{{ checksum "package.json" }} key: v1-dependencies-{{ checksum "package.json" }}
- persist_to_workspace:
root: .
paths:
- .
test:
docker:
- image: cimg/node:16.11.0
working_directory: ~/homebrewery
parallelism: 4
steps:
- attach_workspace:
at: .
# run tests! # run tests!
- run: npm run circleci - run:
name: Test - Basic
command: npm run test:basic
- run:
name: Test - Mustache Spans
command: npm run test:mustache-span
- run:
name: Test - Routes
command: npm run test:route
workflows:
build_and_test:
jobs:
- build
- test:
requires:
- build

View File

@@ -32,13 +32,16 @@ const Homebrew = createClass({
} }
}; };
}, },
getInitialState : function() { getInitialState : function() {
global.account = this.props.account; global.account = this.props.account;
global.version = this.props.version; global.version = this.props.version;
global.enable_v3 = this.props.enable_v3; global.enable_v3 = this.props.enable_v3;
global.config = this.props.config; global.config = this.props.config;
return {};
return {};
}, },
render : function (){ render : function (){
return ( return (
<Router location={this.props.url}> <Router location={this.props.url}>

View File

@@ -14,12 +14,10 @@ const Navbar = createClass({
}; };
}, },
componentDidMount : function() { getInitialState : function() {
//const isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor); return {
this.setState({ ver : global.version
//showNonChromeWarning : !isChrome, };
ver : window.version
});
}, },
/* /*

View File

@@ -20,6 +20,9 @@
"verify": "npm run lint && npm test", "verify": "npm run lint && npm test",
"test": "jest", "test": "jest",
"test:dev": "jest --verbose --watch", "test:dev": "jest --verbose --watch",
"test:basic": "jest tests/markdown/basic.test.js --verbose",
"test:mustache-span": "jest tests/markdown/mustache-span.test.js --verbose",
"test:route": "jest tests/routes/static-pages.test.js --verbose",
"phb": "node scripts/phb.js", "phb": "node scripts/phb.js",
"prod": "set NODE_ENV=production && npm run build", "prod": "set NODE_ENV=production && npm run build",
"postinstall": "npm run buildall", "postinstall": "npm run buildall",
@@ -31,6 +34,7 @@
"build/*" "build/*"
], ],
"jest": { "jest": {
"testTimeout" : 15000,
"modulePaths": [ "modulePaths": [
"mode_modules", "mode_modules",
"shared", "shared",