[bash] Test Fails
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- $ npm test
- npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
- > GoNext@0.0.1 test
- > jest
- PASS frontend/__tests__/ActivitySelector_test.js
- PASS frontend/__tests__/ItineraryGenerator_test.js
- FAIL frontend/__tests__/Round_test.js
- ● Test suite failed to run
- Jest encountered an unexpected token
- This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
- By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
- Here's what you can do:
- • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it.
- • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
- • If you need a custom transformation specify a "transform" option in your config.
- • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
- You'll find more details and examples of these config options in the docs:
- https://jestjs.io/docs/en/configuration.html
- Details:
- C:\Users\Clonix\Documents\GoNext\node_modules\react-native-vector-icons\Feather.js:6
- import createIconSet from './lib/create-icon-set';
- ^^^^^^
- SyntaxError: Cannot use import statement outside a module
- 7 | View,
- 8 | } from 'react-native';
- > 9 | import Feather from 'react-native-vector-icons/Feather';
- | ^
- 10 | import Icon5 from 'react-native-vector-icons/FontAwesome5';
- 11 | import Icon from 'react-native-vector-icons/FontAwesome';
- 12 | import Swiper from 'react-native-deck-swiper';
- at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
- at Object.<anonymous> (frontend/screens/Round.js:9:1)
- FAIL frontend/__tests__/Match_test.js
- ● Test suite failed to run
- Jest encountered an unexpected token
- This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
- By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
- Here's what you can do:
- • If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/en/ecmascript-modules for how to enable it.
- • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
- • If you need a custom transformation specify a "transform" option in your config.
- • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
- You'll find more details and examples of these config options in the docs:
- https://jestjs.io/docs/en/configuration.html
- Details:
- C:\Users\Clonix\Documents\GoNext\node_modules\@fortawesome\react-native-fontawesome\index.js:1
- ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){export { default as FontAwesomeIcon } from './dist/components/FontAwesomeIcon'
- ^^^^^^
- SyntaxError: Unexpected token 'export'
- 11 | } from 'react-native';
- 12 | import {faMapMarkerAlt, faUtensils} from '@fortawesome/free-solid-svg-icons';
- > 13 | import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome';
- | ^
- 14 | import Icon from 'react-native-vector-icons/FontAwesome';
- 15 | import getStarPath from '../assets/stars/star.js';
- 16 | import imgStyles from '../styles/cardImage.js';
- at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14)
- at Object.<anonymous> (frontend/cards/RoundCard.js:13:1)
- FAIL frontend/__tests__/Home_test.js
- ● Home.js tests › renders as expected
- expect(received).toMatchSnapshot()
- Snapshot name: `Home.js tests renders as expected 1`
- - Snapshot - 3
- + Received + 43
- @@ -1,6 +1,37 @@
- <View
- + accessibilityIgnoresInvertColors={true}
- + style={
- + Object {
- + "flex": 1,
- + }
- + }
- + >
- + <Image
- + source={
- + Object {
- + "testUri": "../../../frontend/assets/stars/background.png",
- + }
- + }
- + style={
- + Array [
- + Object {
- + "bottom": 0,
- + "left": 0,
- + "position": "absolute",
- + "right": 0,
- + "top": 0,
- + },
- + Object {
- + "height": undefined,
- + "width": undefined,
- + },
- + undefined,
- + ]
- + }
- + />
- + <View
- style={
- Object {
- "flex": 1,
- "justifyContent": "space-evenly",
- }
- @@ -13,21 +44,28 @@
- "color": "#F15763",
- "fontFamily": "CircularStd-Medium",
- },
- Object {
- "fontFamily": "CircularStd-Bold",
- - "fontSize": 61,
- + "fontSize": 65,
- + "fontWeight": "600",
- "lineHeight": 82.5,
- "margin": "25%",
- - "marginTop": "35%",
- + "marginTop": "45%",
- "textAlign": "center",
- + "textShadowColor": "#55443",
- + "textShadowOffset": Object {
- + "height": 2,
- + "width": 2,
- + },
- + "textShadowRadius": 12,
- "width": "50%",
- },
- ]
- }
- >
- - Welcome to GoNext!
- + Welcome To GoNext!
- </Text>
- <View>
- <View
- accessible={true}
- focusable={true}
- @@ -45,10 +83,11 @@
- "borderRadius": 40,
- "borderWidth": 2,
- "height": 45,
- "justifyContent": "center",
- "margin": "5%",
- + "marginTop": "20%",
- "width": 375,
- }
- }
- >
- <Text
- @@ -104,8 +143,9 @@
- ]
- }
- >
- Restaurant Swiping
- </Text>
- + </View>
- </View>
- </View>
- </View>
- 12 | it('renders as expected', () => {
- 13 | const homerender = renderer.create(<Home></Home>).toJSON()
- > 14 | expect(homerender).toMatchSnapshot()
- | ^
- 15 | })
- 16 | })
- at Object.<anonymous> (frontend/__tests__/Home_test.js:14:28)
- › 1 snapshot failed.
- ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.
- 39 |
- 40 | const tagsDiet = ['Vegan', 'Vegetarian'];
- > 41 |
- | ^
- 42 | const tagsRound = ['10', '20', '30', '40', '50'];
- 43 |
- 44 | const date = new Date();
- at Object.get PermissionsAndroid [as PermissionsAndroid] (node_modules/react-native/index.js:188:12)
- at frontend/screens/RestaurantFilters.js:41:32
- at tryCallOne (node_modules/promise/lib/core.js:37:12)
- at node_modules/promise/lib/core.js:123:15
- at flush (node_modules/asap/raw.js:50:29)
- ● Cannot log after tests are done. Did you forget to wait for something async in your test?
- Attempted to log "ERROR: could not process request for location".
- 45 |
- 46 | // requests the users permission
- > 47 | const requestLocationPermission = async () => {
- | ^
- 48 | PermissionsAndroid.request(
- 49 | PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
- 50 | {
- at console.log (node_modules/@jest/console/build/BufferedConsole.js:197:10)
- at frontend/screens/RestaurantFilters.js:47:15
- at tryCallOne (node_modules/promise/lib/core.js:37:12)
- at node_modules/promise/lib/core.js:123:15
- at flush (node_modules/asap/raw.js:50:29)
- PASS frontend/__tests__/RestaurantFilters_test.js
- ● Console
- console.warn
- "PermissionsAndroid" module works only for Android platform.
- at PermissionsAndroid.<anonymous> (node_modules/react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js:230:15)
- at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
- at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)
- at node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:7
- at tryCallTwo (node_modules/promise/lib/core.js:45:5)
- at doResolve (node_modules/promise/lib/core.js:200:13)
- at new Promise (node_modules/promise/lib/core.js:66:3)
- FAIL backend/__tests__/yelpQuery_test.js
- ● POST /restaurants › should not return a list of restaurants if no location provided
- expect(received).toBe(expected) // Object.is equality
- Expected: "Error getting restaurants: provide a location parameters"
- Received: "Error getting restaurants: provide location parameters"
- 31 | const res = await request(baseURL).post("/restaurants").send({});
- 32 | expect(res.statusCode).toBe(500);
- > 33 | expect(res.body.message).toBe("Error getting restaurants: provide a location parameters")
- | ^
- 34 | });
- 35 | it("should not return a list of restaurants if bad params provided", async () => {
- 36 | const badParams = {
- at Object.<anonymous> (backend/__tests__/yelpQuery_test.js:33:30)
- at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
- at _next (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)
- at tryCallOne (node_modules/promise/lib/core.js:37:12)
- at node_modules/promise/lib/core.js:123:15
- at flush (node_modules/asap/raw.js:50:29)
- Snapshot Summary
- › 1 snapshot failed from 1 test suite. Inspect your code changes or run `npm test -- -u` to update them.
- Test Suites: 4 failed, 3 passed, 7 total
- Tests: 2 failed, 12 passed, 14 total
- Snapshots: 1 failed, 1 passed, 2 total
- Time: 3.11 s
- Ran all test suites.
Editor
You can edit this paste and save as new:
File Description
- Test Fails
- Paste Code
- 02 Dec-2022
- 10.45 Kb
You can Share it: