This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "data": [ | |
| "http://www.homerswebpage.com/", | |
| "https://etereo.io/" | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| storiesOf('my-front/UI/Button', module) | |
| .add('Button', () => <ButtonsSet />) | |
| .add('Button Link', () => ( | |
| <> | |
| <Button | |
| variant="contained" | |
| component="a" | |
| href="https://google.es" | |
| target="_blank" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('On submit form', () => { | |
| it('the popover is rendered', async () => { | |
| const store = createStore() | |
| const { container, getByText, getByTestId } = render( | |
| <ReduxProvider store={store}> | |
| <CheckCoverageContainer /> | |
| </ReduxProvider> | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('<PriceCard />', () => { | |
| it('renders <PriceCard /> component', async () => { | |
| const { container } = render( | |
| <PriceCard data={mockData} onAddToCart={() => {}} /> | |
| ) | |
| expect(container).toMatchSnapshot() | |
| }) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('formatNumber function', () => { | |
| it('works with strings', () => { | |
| const formatted = formatNumber('12.45') | |
| expect(formatted).toEqual('12,45') | |
| }) | |
| it('works with numbers', () => { | |
| const formatted = formatNumber(12.45) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stylesRegexp = /<style ng-transition="thor">(.*?(\n))+.*?<\/style>/g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // app.component.ts | |
| ... | |
| import { TransferState, makeStateKey } from '@angular/platform-browser'; | |
| const PHOTOS = makeStateKey('photos'); | |
| @Component({...}) | |
| export class AppComponent implements OnInit { | |
| opened: boolean; | |
| photos: any[]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "angular-universal-example", | |
| ... | |
| "scripts": { | |
| "ng": "ng", | |
| "start": "ng serve", | |
| "start:ssr": "node dist/server.js", | |
| "build": "run-s build:client build:aot build:server", | |
| "build:client": "ng build -prod --build-optimizer --app 0", | |
| "build:aot": "ng build --aot --app 1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // webpack.config.ts | |
| const path = require('path'); | |
| var nodeExternals = require('webpack-node-externals'); | |
| module.exports = { | |
| entry: { | |
| server: './src/server.ts' | |
| }, | |
| resolve: { | |
| extensions: ['.ts', '.js'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // server.ts | |
| import 'reflect-metadata'; | |
| import 'zone.js/dist/zone-node'; | |
| import { renderModuleFactory } from '@angular/platform-server'; | |
| import { enableProdMode } from '@angular/core'; | |
| import * as express from 'express'; | |
| import { join } from 'path'; | |
| import { readFileSync } from 'fs'; | |
| enableProdMode(); |
NewerOlder