Help needed with Advanced Node and Express - Handle a Disconnect https://learn.freecodecamp.org/information-security-and-quality-assurance/advanced-node-and-express/handle-a-disconnect

I dont know why I’m failing one of the test Server handles the event disconnect from a socket

'use strict';

const express     = require('express');
const session     = require('express-session');
const bodyParser  = require('body-parser');
const fccTesting  = require('./freeCodeCamp/fcctesting.js');
const auth        = require('./app/auth.js');
const routes      = require('./app/routes.js');
const mongo       = require('mongodb').MongoClient;
const passport    = require('passport');
const cookieParser= require('cookie-parser')
const app         = express();
const http        = require('http').Server(app);
const sessionStore= new session.MemoryStore();
const io          = require('socket.io')(http);
const cors = require('cors');

app.use(cors());

fccTesting(app); //For FCC testing purposes

app.use('/public', express.static(process.cwd() + '/public'));
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'pug')

app.use(session({
  secret: process.env.SESSION_SECRET,
  resave: true,
  saveUninitialized: true,
  key: 'express.sid',
  store: sessionStore,
}));

var currentUsers = 0;


mongo.connect(process.env.DATABASE, (err, db) => {
    if(err) console.log('Database error: ' + err);
  
    auth(app, db);
    routes(app, db);
      
    http.listen(process.env.PORT || 3000);

  
    //start socket.io code  
    
  io.on('connection', socket => {
    console.log('A user has connected');
    ++currentUsers;
    io.emit('user count', currentUsers);
  });

  io.on('disconnect', socket => {
    console.log('A user has disconnect');
    --currentUsers;
    io.emit('user count', currentUsers);
  });
    //end socket.io code
  
  
});

my server.js file

$( document ).ready(function() {
  
  
   /*global io*/
  var socket = io();
  
  socket.on('user count', function(data){
    console.log('A user connect');
  });
  
  socket.on('user count', function(data){
    console.log('A user disconnect');
  });
  
  // Form submittion with new message in field with id 'm'
  $('form').submit(function(){
    var messageToSend = $('#m').val();
    //send message to server here?
    $('#m').val('');
    return false; // prevent form submit from refreshing page
  });
  
    
});

client.js

pls help, tnx.